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

Free Support Forum - aspose.com

#IfError function not working when save to PDF

Hi,

I create an Aspose.Cells.Worksheet with cell B6 = 4, B7 = 5, and cell B8 have formula =IFERROR(B6/B7,0)) , when I save this workbook to excel, the cell B8 has correct value 0.8, but when I save this workbook to PDF, the cell B8 shows as “#Name”. Is this a bug?

Thanks,
Wei

Hi Wei,

Thanks for your posting and using Aspose.Cells.

You should call Workbook.CalculateFormula() before saving to PDF. Please also download and try the latest version: Aspose.Cells
for .NET v8.2.1.3
it works fine.

I have tested this issue with the following sample code. I have attached the output Excel and PDF file for your reference.

C#


Workbook workbook = new Workbook();


Worksheet worksheet = workbook.Worksheets[0];


worksheet.Cells[“B6”].PutValue(4);

worksheet.Cells[“B7”].PutValue(5);


worksheet.Cells[“B8”].Formula = “=IFERROR(B6/B7,0))”;


workbook.CalculateFormula();


workbook.Save(“output.xlsx”);


workbook.Save(“output.pdf”);

Thanks for the update. You are right, for the most of scenarios, it works. But we have an saved workbook, convert to pdf it doesn’t work. I have upload this excel work book, you can use the following code to open and save it to pdf, you will see the output.pdf has “#Name” instead value for the IFERROR formula.

Dim wb As Workbook = New Workbook(“C:\IFERROR.xlsx”)
wb.CalculateFormula()
wb.Save(“C:\output.pdf”, SaveFormat.Pdf)

Please let me know if you have any question.

Thanks,
Wei

Hi Wei,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after executing your sample code with your source Excel file using the latest version: Aspose.Cells
for .NET v8.2.1.3
. IfError function is not calculated properly and shows #NAME? instead of correct value.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-43072.

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v8.2.1.4 (attached).

We have fixed your issue now.

Let us know your feedback.

Thank you.

Thanks for the update. The problem is fixed now.

Hi Wei,

Thanks for your feedback and using Aspose.Cells.

It is
good to know that your issue is resolved with the latest release. Let
us know if you encounter any other issue, we will be glad to look into
it and help you further.

Hi,


Thanks for your feedback.

You would also like to try our latest official release of the product i.e., Aspose.Cells for .NET v8.2.2 which includes the functionality of the fix. You may download the latest release here:
http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry579884.aspx

Thank you.