This project has moved. For the latest updates, please go here.

Loading existing Excell throws object reference null

Apr 13, 2012 at 8:07 AM

I'm using ClosedXML to read an existing Excel sheet. I tried to load the Excel using a stream. When I load the excell I get an Object reference not set to an instance of an object. exception. This occurs in the line: 

EnumValue<ReferenceModeValues> referenceMode = dSpreadsheet.WorkbookPart.Workbook.CalculationProperties.ReferenceMode;

of the LoadSpreadsheetDocument method.

It apears that the CalculationProperties property is null, so the call to the ReferenceMode throws the exception. Has anybody any idea why this is?

Coordinator
Apr 14, 2012 at 3:57 AM

Fixed. Pick up the latest source code.

Apr 14, 2012 at 7:56 AM

Thanks for the quick solution.