Hello,
Apologies for the late answer.
I could reproduce a similar error with the following file: http://speedy.sh/T84cG/ClosedXML-CommentIssue.xlsx
As described in the original post, this file cannot be opened as long as there's a comment in the A2 cell. By deleting the comment, the file opens again.
The error occurs at the same line (XLWorkbook constructor), however the error details are slightly different (I'm not sure why, but the basic problem remains the same - the file can't be opened):
Martin
Apologies for the late answer.
I could reproduce a similar error with the following file: http://speedy.sh/T84cG/ClosedXML-CommentIssue.xlsx
As described in the original post, this file cannot be opened as long as there's a comment in the A2 cell. By deleting the comment, the file opens again.
The error occurs at the same line (XLWorkbook constructor), however the error details are slightly different (I'm not sure why, but the basic problem remains the same - the file can't be opened):
System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet)
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName)
at ClosedXML.Excel.XLWorkbook.Load(String file)
at ClosedXML.Excel.XLWorkbook..ctor(String file, XLEventTracking eventTracking)
at ClosedXML.Excel.XLWorkbook..ctor(String file)
Thanks in advance,Martin