Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

"Object reference not set to an instance of an object." after removing Pivot table source #68

Closed
@paaresh

Description

Version : 4.5.0-beta
I am getting "Object reference not set to an instance of an object." in below case :

  1. Using EPPlus, Create new xlsx with Worksheet name "Sheet1" and data with table name "Table1" and save it
  2. Manually I added pivot table base on "Table1" using MS Office 2013
  3. 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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions