Free Support Forum - aspose.com

Calculation fails with: com.aspose.cells.CellsException: java.lang.NullPointerException: null("Based on cell "Companies Broker!H7)

Hi,

Using Aspose Cells for Java, version 20.4.

Calculating the linked workbook results in the following exception:

Exception in thread "main" com.aspose.cells.CellsException: java.lang.NullPointerException: null("Based on cell "Companies Broker!H7)
	at com.aspose.cells.zaec.a(Unknown Source)
	at com.aspose.cells.zaec.a(Unknown Source)
	at com.aspose.cells.zaed.a(Unknown Source)
	at com.aspose.cells.zaed.b(Unknown Source)
	at com.aspose.cells.zaec.b(Unknown Source)
	at com.aspose.cells.Workbook.calculateFormula(Unknown Source)
	at com.aspose.cells.Workbook.calculateFormula(Unknown Source)
	at com.aspose.cells.Workbook.calculateFormula(Unknown Source)
	at my.main.method.Test.main(Test.java:15)

Sample code:

Workbook workbook = new Workbook("sample.xlsx");
workbook.calculateFormula();

Please note that the calculation takes about 2 hours before failing, while the calculation completes in Excel in around 15 minutes.

Link to reproduction workbook: https://1drv.ms/u/s!AtPL-qSRXJ4ajbg9nrUTLBtnQAaOlg?e=LpAEp2

Kind regards,
Taras

@TarasTielkes,
We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSJAVA-43170 – CellsException on calculateFormula method

Hi @ahsaniqbalsidiqui,

We managed to reduce the test case to a small calculation that fails within a few seconds.
This should hopefully make it much easier for you to investigate.

After loading the attached workbook, we simply call calculateFormula().

Kind regards,
Taras
sample_fails_quick.zip (3.3 MB)

@TarasTielkes,
Thank you for providing more information. We will analyze it and provide our feedback accordingly.

@TarasTielkes,

Please try our latest version/fix: Aspose.Cells for Java v20.4.3 (attached)

Your issue should be fixed in it. We have fixed the issue of NPE. For the performance of formula calculations, we are looking into it to check whether we can make further improvements.

Let us know your feedback.
aspose-cells-20.4.3-java.zip (7.0 MB)

Hi @Amjad_Sahi,

Is the fix for the exception included in the 20.5 release of Aspose Cells for Java?

It is good to hear that you are looking into the underlying performance aspects of the reported test case.

Kind regards,
Taras

@TarasTielkes,
Yes, the fix for the exception is included in the latest release 20.5. We will write back here once any other update is ready to share.