2019-07-25 19:43:46 +03:00
|
|
|
// Copyright 2017 FoxyUtils ehf. All rights reserved.
|
2017-09-08 21:25:01 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
2019-05-04 11:18:06 +03:00
|
|
|
"github.com/unidoc/unioffice/spreadsheet"
|
2017-09-08 21:25:01 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
ss := spreadsheet.New()
|
|
|
|
sheet := ss.AddSheet()
|
|
|
|
|
|
|
|
sheet.Cell("A1").SetString("Hello World!")
|
|
|
|
sheet.Comments().AddCommentWithStyle("A1", "Gopher", "This looks interesting.")
|
|
|
|
sheet.Comments().AddCommentWithStyle("C10", "Gopher", "This is a different comment.")
|
|
|
|
|
|
|
|
if err := ss.Validate(); err != nil {
|
|
|
|
log.Fatalf("error validating sheet: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
ss.SaveToFile("comments.xlsx")
|
|
|
|
}
|