There is a bug with reusing the memory stream on save when the comments collection is modified. If the new comment xml byte stream is shorter than what was previously read, the old content will spill over ( Part.GetStream() sets the existing stream to position 0). In most cases the result is an invalid xml causing Excel to throw "Excel found unreadable content in....." when trying to parse xl\comments{SheetId}.xml when opening the file.
Solution:
At ExcelWorkSheet.cs line 2878:
_comments.CommentXml.Save(_comments.Part.GetStream());
needs to be:
_comments.CommentXml.Save(_comments.Part.GetStream(FileMode.Create));
in order to get a new memory stream
regards // Fredrik
Solution:
At ExcelWorkSheet.cs line 2878:
_comments.CommentXml.Save(_comments.Part.GetStream());
needs to be:
_comments.CommentXml.Save(_comments.Part.GetStream(FileMode.Create));
in order to get a new memory stream
regards // Fredrik