Exception of type \u0005\u0003\u0017 and bad performance of CalculateFormula() with Aspose.Cells for .NET in C#

Hello,

I have a batch calculation in .NET C# where I access an Excel workbook using Aspose.Cell. It basically works great, but when running CalculateFormula() it throws an exception ‘Exception of type ‘\u0005\u0003\u0017’ was thrown’ very many times in a row. Also the performance is very low, depending on the Excel used. I have attached the Forms application, in the last test case performing CalculateFormula() takes about 40 seconds, which is a bit long but still ok. The first test case takes about 2.5 minutes. This is actually too long, although the Excel is even less complex.

All you have to do is start the application, select the first or last row in the grid and click on ‘Batch starten’ at the bottom right. The exception occurs in all cases. Please ignore the file not found or xml parser exceptions, they should not have an effect.
ExcelBatchTool.zip (2,7 MB)

Aspose.Cell version 24.7.0 is installed.

I use ignoreError = true, but that does not help.

Can you please help?

Kind regards

@cwandschura
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-56263

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@cwandschura
There are many shared formulas in the template file and those shared formulas reference to each other. Such kind of situation may lead to a stack overflow error due to an excessively deep call stack.

Specifing a smaller value for CalcStackSize when calculating formulas should be able to solve the issue.

By our test below code can make the calculation succeed:

rechenWorkbook.CalculateFormula(new CalculationOptions() { CalcStackSize = 100 });

Please try it to see whether it can work for you.