Saving as XLSX or XLSB file format throws an exception "Object reference not set to an instance of an object" in .NET

Reference thread: ``

  1. I have some xlsb files and want to save as xlsx. These files can be opened with MS Excel and my code throws exceptions. My aspose cells is 17.5.0.0
    string inputFile = “C:\sample.xlsb”;
    LoadOptions options = new LoadOptions(LoadFormat.Xlsb);
    Workbook doc = new Workbook(inputFile, options);
    doc.Save(outputFile, SaveFormat.Xlsx);
  1. I also have a xlsx file and failed to save in xlsb
    string inputFile = “C:\sample.xlsx”;
    LoadOptions options = new LoadOptions(LoadFormat.Xlsx);
    Workbook doc = new Workbook(inputFile, options);
    doc.Save(outputFile, SaveFormat.Xlsb);

This Topic is created by Amjad_Sahi using the Email to Topic plugin.

Hi,

Please try our latest version/fix: Aspose.Cells for .NET v17.6.1:
Aspose.Cells for .NET v17.6.1 (.NET 2.0)
Aspose.Cells for .NET v17.6.1 (.NET 4.0)

All your issues should be fixed in it.

Let us know your feedback.

Thank you.

The issues you have found earlier (filed as CELLSNET-45430) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi

The issues you have found earlier (filed as CELLSNET-45431) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi

The issues you have found earlier (filed as CELLSNET-45432) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi

The issues you have found earlier (filed as CELLSNET-45433) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi

The issues you have found earlier (CELLSNET-45430 to CELLSNET-45433) have been fixed in this update.

Thanks for your support, Amjad Sahi

Hi @Amjad_Sahi

I used Aspose Cell 17.7, and I found these file .xlsx still failed to save as xlsb. Could you check the issues again.
sample_dataset_pass_123456.zip (54.2 KB)

Thanks

@HanLuong,

Thanks for providing us template XLSX files.

After an initial test, I observed the issue as you mentioned by converting your XLSX files (in the attached archive) to XLSB file format. I found an exception: “Object reference not set to an instance of an object” when saving the XLSX files to XLSB file format:
e.g
Sample code:

 Workbook wb = new Workbook(strFileName); 
            wb.Save("e:\\test2\\out1.xlsb");//Exception  

I have logged a ticket with an id “CELLSNET-45526” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

Thank you.

1 Like

@HanLuong

Thanks for using Aspose APIs.

Please download and try the following fix (for the issue CELLSNET-45526) and let us know your feedback.

[Aspose.Cells for .NET v17.7.4]

The issues you have found earlier (filed as CELLSNET-45526) have been fixed in latest version of Aspose.Cells for .NET (Download | NuGet).