Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Commented Unassigned: Mass deleting then creating comments causes corruption [14922]

$
0
0
I used the latest source code (commit 1c0510c8d300, Aug 08, 2013) to see if this was fixed or not, but it doesn't seem to be.

If you follow these steps you end up with a corrupted spreadsheet:

- Add comments to a worksheet
- Save and close package

- Open package
- Delete all comments (i use this line of code)
```
while (curWorksheet.Comments.Count > 0) curWorksheet.Comments.RemoveAt(curWorksheet.Comments.Count - 1);
```
- Re-add comments
- Save and close the package

Now when you try and open it in excel you will get a message like: "Removed Part: /xl/comments1.xml part with XML error. (Comments) Incorrect document syntax. Line X, column X."
```

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error035320_02.xml</logFileName><summary>Errors were detected in file '\\sh172edt\home\u413975\_ImportInProgressCAEZAHNP.xlsx'</summary>-<removedParts summary="Following is a list of removed parts:"><removedPart>Removed Part: /xl/comments1.xml part with XML error. (Comments) Incorrect document syntax. Line 19, column 27.</removedPart></removedParts></recoveryLog>
```
Comments: I really wish I had a happy ending for you. Here are your options: - Download the latest beta and see if the issue is fixed (developer has worked on it recently) - Create a new worksheet and copy the data across then delete the worksheet with the columns - Set the comments to blank rather than null (simple but inelegant, as it leaves comment indicators all over the sheet). - Download the source, fix the issue and then publish it here and hope the developer merges your changes, meanwhile use your own .dll Personally I went with option 2 as the spreadsheets I were making contained LOTs of comments but fairly few rows/columns. (average 200 rows, 30 columns) Please be aware though that there are also issues with creating/deleting worksheets which have the same name. (try creating a worksheet, naming it, deleting it, recreating it and then referencing it by name and often it will fall over).

Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>