"Object reference not set to an instance of an object." after removing Pivot table source #68
Description
Version : 4.5.0-beta
I am getting "Object reference not set to an instance of an object." in below case :
- Using EPPlus, Create new xlsx with Worksheet name "Sheet1" and data with table name "Table1" and save it
- Manually I added pivot table base on "Table1" using MS Office 2013
- Using EPPlus, Delete "Sheet1" and new worksheet with name "Sheet1" and add some data with table name "Table3" and call ExcelPackage.Save(). It will throw error.
It should allow to save excel file even though there is missing reference (Same like "ClosedXML").
System.InvalidOperationException: Error saving file G:\Export\exp_2.xlsx ---> System.NullReferenceException: Object reference not set to an instance of an object.
at OfficeOpenXml.ExcelWorksheet.SavePivotTables()
at OfficeOpenXml.ExcelWorksheet.Save()
at OfficeOpenXml.ExcelWorkbook.Save()
at OfficeOpenXml.ExcelPackage.Save()
--- End of inner exception stack trace ---
at OfficeOpenXml.ExcelPackage.Save()
at Query.CreateExcel(OleDbDataReader dr, String strFile) in G:\Export\Query.aspx.vb:line 4006
at Query.ExportData() in G:\Export\Queryaspx.vb:line 1644