You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.
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
The text was updated successfully, but these errors were encountered:
i spent a chunk of time wracking my brain over this.. in one script task i delete a template worksheet, referencing the spreadsheet by name. in another script task i get a null pointer exception when attempting to reference a different worksheet by name.
after literally scouring my statements for syntax or logic issue, i came to the deduction that there must be something else going on.
on a hunch... i commented out the delete portion, and then it ran ok... then uncommented it out and moved it after the one that was previously erroring.
it's gotta be something with how EPPLUS accesses and modifies the internal excel worksheet indexing, even though in my case the calls to open and individual variable assignments were by using string literals of named worksheets in completely different script tasks.
if i can advise, try not to delete anything until the very end, after all of the references are completed.
hope that helps anyone else
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version : 4.5.0-beta
I am getting "Object reference not set to an instance of an object." in below case :
It should allow to save excel file even though there is missing reference (Same like "ClosedXML").
The text was updated successfully, but these errors were encountered: