Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Created Unassigned: Crashes on XLWorkbook workbook = new XLWorkbook(filename); [9316]

$
0
0
Hello!

I get an InvalidOperationException ("Sequence contains no matching element") when I try to open the attached Excel document. The attached document can be opened with Excel 2010.

I have downloaded the source and found that crasch is on the row below (when loading comments I think):

shape = xdoc.Root.Elements().First(e => (string)e.Attribute("type") == "#_x0000_t202");

Call stack:

at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet) in C:\CCShare\snap\toso06_snap_1406\sora\csharpkod\ClosedXML\ClosedXML\Excel\XLWorkbook_Load.cs:line 334
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName) in C:\CCShare\snap\toso06_snap_1406\sora\csharpkod\ClosedXML\ClosedXML\Excel\XLWorkbook_Load.cs:line 47
at ClosedXML.Excel.XLWorkbook.Load(String file) in C:\CCShare\snap\toso06_snap_1406\sora\csharpkod\ClosedXML\ClosedXML\Excel\XLWorkbook_Load.cs:line 36
at ClosedXML.Excel.XLWorkbook..ctor(String file, XLEventTracking eventTracking) in C:\CCShare\snap\toso06_snap_1406\sora\csharpkod\ClosedXML\ClosedXML\Excel\XLWorkbook.cs:line 642
at ClosedXML.Excel.XLWorkbook..ctor(String file) in C:\CCShare\snap\toso06_snap_1406\sora\csharpkod\ClosedXML\ClosedXML\Excel\XLWorkbook.cs:line 630
at SHB.SORA.BusinessEntities.Excel.Workbook.Load(String filename) in C:\CCShare\snap\toso06_snap_1406\sora\csharpkod\services\SHB.SORA.BusinessEntities\Excel\Workbook.cs:line 30
at SHB.SORA.CreateReport.BatchService.<OnStart>b__0() in C:\CCShare\snap\toso06_snap_1406\sora\csharpkod\services\SHB.SORA.CreateReport\BatchService.cs:line 44
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

I can open other Excel documents with ClosedXML just fine.

Regards,

Tomas Sondén



Viewing all articles
Browse latest Browse all 1877

Trending Articles



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