How to change comments in excel file with go

huangapple go评论82阅读模式
英文:

How to change comments in excel file with go

问题

我正在使用excelize库。

newfile, _ := excelize.OpenFile("filename.xlsx")

println(newfile.GetComments())
//map[Sheet1:[{Author 0 A2 comment1}]]

_ = newfile.InsertRow("Sheet1", 1)

println(newfile.GetComments())
//map[Sheet1:[{Author 0 A2 comment1}]]

我的评论comment1的坐标没有改变。如何解决这个问题?

英文:

I'm using the excelize library.

newfile, _ := excelize.OpenFile("filename.xlsx")

println(newfile.GetComments())
//map[Sheet1:[{Author 0 A2 comment1}]]

_ = newfile.InsertRow("Sheet1", 1)

println(newfile.GetComments())
//map[Sheet1:[{Author 0 A2 comment1}]]

the coordinates of my comment comment1 have not changed. How to solve this problem?

答案1

得分: 1

评论绑定到单元格。当你插入新行时,上面的单元格仍然包含评论。
如果你想在第二行添加评论,你需要明确设置评论。

英文:

The comment is bound to a cell. When you insert a new row, the call above still contains the comment.
If you would like a comment in the second row, you have to set the comment explizit.

huangapple
  • 本文由 发表于 2021年11月11日 04:51:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/69920077.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定