Maximum ammount of (nested) functions per sheet?


#1

Hello, see attachement. I’m not able to calculate this workbook to Aspose. Why?NestedSUMS.zip (3.6 MB)


#2

@jbijsusteen,

Thanks for the template file.

Do you get StackOverflowException when calculating formula? Well, the StackOverflowException might occur when calculating formulas with large volume of values. By using relatively smaller stack size settings, the calculation can be succeeded. You may try to add a line of code (in bold) before calculating formulas to your code:
e.g
Sample code:

Workbook workbook = new Workbook(strFilePath);
workbook.Settings.CalcStackSize = 30;
workbook.CalculateFormula();

Please note WorkbookSettings.CalcStackSize specifies the stack size for calculating cells recursively. The large value for this size will give better performance when there are lots of cells need to be calculated recursively. On the other hand, larger value will raise the risk of StackOverflowException. If a user gets StackOverflowException when calculating formulas, this value should be decreased.

Also, see the document topics for your reference:
https://docs.aspose.com/display/cellsnet/Aspose.Cells+FAQs#Aspose.CellsFAQs-HowtoFixtheSystem.StackOverFlowExceptiononWorkbook.CalculateFormula?

https://docs.aspose.com/display/cellsnet/Aspose.Cells+FAQs#Aspose.CellsFAQs-DeterminewhichstacksizeisneededforacertainWorkbook