Hi there!
First, thank you for your hard work and ongoing support! After fiddling with OOXML myself "manually" for about a month and compiling numerous helper functions I really, really appreciate your effort ;-)
Now I've stumbled upon a rather complex array formula that works fine in Excel 2010 but throws a null reference exception on save() using ClosedXml.
In German this array formula looks like
```
=TEILERGEBNIS(9;INDIREKT("B02:B"&MAX(WENN(ISTLEER(#BEZUG!:B);"";ZEILE(B:B)))))
```
and results in
```
System.NullReferenceException: Object reference not set to an instance of an object.
at ClosedXML.Excel.XLWorkbook.GenerateWorksheetPartContent(WorksheetPart worksheetPart, XLWorksheet xlWorksheet, SaveContext context) in ...\ClosedXML\Excel\XLWorkbook_Save.cs:line 4096
at ClosedXML.Excel.XLWorkbook.CreateParts(SpreadsheetDocument document) in ...\ClosedXML\ClosedXML\Excel\XLWorkbook_Save.cs:line 189
at ClosedXML.Excel.XLWorkbook.CreatePackage(String filePath) in ...\ClosedXML\Excel\XLWorkbook_Save.cs:line 91
at ClosedXML.Excel.XLWorkbook.Save() in ...\ClosedXML\Excel\XLWorkbook.cs:line 413
```
upon save().
Thanks for your help and best regards,
Thomas
Comments: ** Comment from web user: tvoigt **
Hi there!
Thanks for getting back to me so quickly!
While that formula _does_ work in Excel 2010, I agree that it is ugly and I should find a workaround.
But I can't have formulas swallowed on save! I'd rather have an exception thrown pointing to that bad formula and/or cell address than getting back a defunct Excel file without any warning.
Our Excel files are quite large an are being developed by a seperate team (using Excel 2010). So I don't have much control over what formulas are used. It took hours to identify that crazy function. An exception here and there would really help when debugging.
Maybe exceptions should be recorded and
a) only thrown when configured to do so and/or
b) save() returns an output parameter with some kind of error log or list of warnings (e.g. removed formulas/cell values/custom properties)?
Thanks an best regards,
Thomas