We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Updating on XLSX file with Pivotable cause excel error and Aspose error


I have an existing xlsx file that has a pivot table. When I update the source data for the pivot table using Aspose.Cells and then try opening the updated file in Excel I get error message about content being unreadable.
When I open the file again in Aspose I get the following error:

System.NullReferenceException: Object reference not set to an instance of an obj
at Aspose.Cells.Cells.CreateRange(String address)
at ←.?.↨☻(XmlTextReader )
at ←.?.:bangbang::slight_smile:(XmlTextReader )
at ←.?:slight_smile:(XmlTextReader )
at ?.⌂.⌂☻()
at ?.⌂☻()
at ?.:slight_smile:(Workbook , Stream , ▬ )
at Aspose.Cells.Workbook☻(Stream , LoadOptions )
at Aspose.Cells.Workbook…ctor(Stream stream)

If I save the file to the xls format the issue looks to go away.

I have included sample project that takes the source file and create the output file that has errors…

I have also included both the source and output file I am getting.

Any help or direction would be greatly appreciated


Thanks for providing the sample application to replicate the problem mentioned by you and testing it with the latest version:
for .NET v7.0.4.4

I was able to replicate the problem at my end, the output xls file opens fine but output xlsx file throws exception on opening.

We have logged this issue in our database. We will look into it and update you asap.

This issue has been logged as CELLSNET-40261.


Please download and try the latest fix: Aspose.Cells for .NET v7.0.4.5

Thanks for the quick turn around I will try it out.

Also can you tell me which property on the pivot table object would allow me to turn off the Auto Fit Column Widths on Updates.

I have attached a screen shot from Excel of the field I am hoping to change it’s value.

Again thank you for all your help.


Please use PivotTable.IsAutoFormat

See the sample code below:


wb.Worksheets[0].PivotTables[0].IsAutoFormat = false;

The issues you have found earlier (filed as CELLSNET-40261) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.