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

Free Support Forum - aspose.com

Problem to convert Excel to PDF

Hello,
I have problem to convert attached file to PDF.
I am getting ‘Object reference not set to an instance of an object.’ error.
code:
string dataDir = Server.MapPath(“Invoices/”);
Copy of Test_Pg5_1 (002).zip (23.1 KB)
string filePath = dataDir + “Copy of Test_Pg5_1 (002).xlsx”;
Workbook workbook = new Workbook(filePath);
Aspose.Cells.PdfSaveOptions opts = new Aspose.Cells.PdfSaveOptions();
opts.OnePagePerSheet = true;
workbook.Save(dataDir + “output_To_PDF.pdf”, opts);

Please help.

@rudolfkalik,

Thanks for the template file and sample code.

After an initial test, I observed the issue as you mentioned by using your sample code with your template file. I found an exception: “Object reference not set to an instance of an object” when rendering an Excel file to PDF. I have logged a ticket with an id “CELLSNET-46075” for your issue. We will look into it soon.

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

@rudolfkalik

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSNET-46075 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

@rudolfkalik

Thanks for using Aspose APIs.

Please download and try the following fix and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-46075) have been fixed in this update. Please also check the document/article for your reference: https://docs.aspose.com/display/cellsnet/Installation