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

Free Support Forum - aspose.com

NullReferenceException in CalculateFormulas

Hello, I am hitting a NullReferenceException when doing CalculateFormula:


LightStation.API.OracleException: Error in calculating cell [Sheet01!C119]: NullReferenceException: Object reference not set to an instance of an object —> Aspose.Cells.CellsException: Error in calculating cell [Sheet01!C119]: NullReferenceException: Object reference not set to an instance of an object
at Aspose.Cells.Workbook.CalculateFormula (Boolean ignoreError, ICustomFunction customFunction) [0x00000] in :0
at Aspose.Cells.Workbook.CalculateFormula () [0x00000] in :0

The formula for the cell looks like:
=IFERROR(CORREL(‘Correlation Data’!M:M,‘Correlation Data’!$O:$O),“N/A”)

Can you please help?

Hi William,


Thank you for contacting Aspose support.

The exception details suggest that the problem is specific to a certain sample therefore please share the original spreadsheet (causing this problem) along with code to replicate the problem on our side. However, before you move forward to provide us the above requested, please give a try to the latest version of Aspose.Cells for .NET 8.5.2.3 to see if you can replicate the exception.

In case you have any concerns regarding the privacy of your data, you may send the samples via an email while using the contact button on the post window. Once you have sent the email, please confirm us here as well.

Hello, I can send you the workbook if the formula is not sufficient to reproduce the problem. Please provide me with a private e-mail to send this to as it contains sensitive customer data.

I just saw the sentence about the contact button. I’ll send it along using that.

Hi William,


Sure, please send the sample via an email using the contact button on the post window. Once you have sent the message, please intimate us here as well because some times the external messages end up in the junk folder.

It’s been sent. Please let me know when you’ve received it.

Hi again,


I have received your sample, and evaluated it against the latest version of Aspose.Cells for .NET 8.5.2.3. I am afraid, I am not able to observe any problem while calling the Workbook.CalculateFormula method. Please note, I have simply loaded the provided spreadsheet and called the aforesaid method.

That said, I have provided the download link to the latest API in one of my previous responses. Have you given it a try on your side? In case the problem persists even with the latest revision of the API, please provide more details of your operating environment along with your complete code in case you are manipulating the spreadsheet before calling the Workbook.CalculateFormula method. We need the following details to investigate the problem further.

  • Operating system version & architecture
  • Target .NET framework version
  • Locale/Regional setting of the machine
  • Source code to replicate the problem

Upgrading to 8.5.2.3 does seem to have fixed the problem. Thank you!

Hi William,


Thank you for the confirmation, and it is good to know that you are up & running again. Please feel free to contact us back in case you need our further assistance with Aspose APIs.