excelize
excelize copied to clipboard
add function to remove or update comment in a cell
when we try to add comment to a cell with comment, when open the excel file, the excel program will complain about 'there is an error occur, but we has recovery from it'
Hi @coreyzzp, thanks for your feedback, could you provide any code and attachments to reproduce this issue?
func TestCreateExcelAndUpdateComment(t *testing.T) {
target := "test.xlsx"
target2 := "test-after.xlsx"
{
var err error
fd := excelize.NewFile()
err = fd.AddComment("Sheet1", "A1", fmt.Sprintf(`{"author":"Excelize: ","text":"This is a comment" }`))
require.Nil(t, err)
err = fd.SaveAs(target)
require.Nil(t, err)
// here open test.xlsx is find
}
{
fd, err := excelize.OpenFile(target)
require.Nil(t, err)
err = fd.AddComment("Sheet1", "A1", fmt.Sprintf(`{"author":"Excelize: ","text":"hello world"}`))
require.Nil(t, err)
err = fd.SaveAs(target2)
require.Nil(t, err)
// now open test-after.xlsx an error popup
}
}
open test.xlsx
open test-after.xlsx
it will be good to has a method to delete or update comment in a cell
This lib doesn't support modify comment and set the comment repeatedly on one cell currently. I've add this feature support in the Roadmap.
thx~
find an article about "comments" and "notes": The difference between threaded comments and notes
[WeOpen Star] I would like to help
[WeOpen Star] I would like to help