Can any 1 provide me with me with working example of 'How to add comments in a spreadsheet" programmatically.
I have tried this and have ran into issues , everytime i get an error when i open the excel file ,
Excel repairs the sheet by removing the drawing element.
I dont know how to proceed on this .
Thanks........
I just did a little research on this. I created a spreadsheet with a comment and then tried manually editing the XML to move that comment to a different cell. It looks like the cell reference appears in comments part. It also has to match a drawing referenced from the legacyDrawing element in the sheet. These drawings have a lot of elements that I am not familiar with, but it seemed to work when I changed the x:Row and/or the x:Column elements to match the cell reference in the comment. I noticed that x:Row and x:Column are zero-based indexes.
To solve your problem, I would manually create a spreadsheet that looks that way you think your generated spreadsheet should look and then compare the XML for differences.
I'm not aware of any sample code for comments in spreadsheets.
I've a functional version here which might be enough to get you started.
in addition to specifying the lecgacyDrawing in your worksheet, you will be adding in a comments document that lists the authors and comments:
github.com/.../comments.rb
github.com/.../comment.rb
as well as a bit of vml:
github.com/.../vml_drawing.rb
github.com/.../vml_shape.rb
Hope this helps!