I would like to add comments at one cell, So.. I did:
...
ExcelPackage package = new ExcelPackage(new MemoryStream());
var ws = package.WorkBook.WorkSheet[1];
ws.Cells[1, 1].AddComment("Lot Price: $12,000", "");
...
package.SaveAs(new FileInfo("fileout.xlsx"));
package.Dispose();
When try open the resulted "fileout.xlsx", it showed a dialog box saying to recover as much as possible... Then the recovered fileout.xlsx displays errors:
"Removed Part: /xl/comments1.xml part with XML error. (Comments) Load error. Line 5, column 0. Removed Part: /xl/comments5.xml part with XML error. (Comments) Load error. Line 5, column 24."
It appears that EPPlus produced a wrong format xml when there are comments. I would like to share my solutions for this problem:
I just added a NON-BLANK header line for the comments, such as "REF" here:
ws.Cells[1, 1].AddComment("Lot Price: $12,000", "REF");
I hope someone might be helped by this.
Some one suggested to post it as answer. Here it is:
The problem disappears if like this: I just added a NON-BLANK header line for the comments, such as "REF" here:
ws.Cells[1, 1].AddComment("Lot Price: $12,000", "REF");
I hope someone might be helped by this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With