Calculation Models (Manual- Before Save- etc.)


#1

I'm using the eval software to determine if I can replace Excel Automation in an ASP app. At one point, I use the Excel application object's "Calculation" and "CalculateBeforeSave" methods to temporarily turn off Excel's calculation during subsequent operations. For example:

oWB_EUR.Application.Calculation = Excel.XlCalculation.xlCalculationManual;
oWB_EUR.Application.CalculateBeforeSave = true;

(oWB_EUR is an Excel workbook object).

Question: What does ASPOSE.Cells do about recalculation while I programmatically modify individual cells? Does it calculate at all? Are the Workbook.CalculateFormula methods in some way equivalent?

Thanks


#2

When you modify individual cells, Aspose.Cells won't recalculate formulas for it will heavily degrade performance. To recalculate formulas, you should explicit call Workbook.CalculateFormula method after you modify cells.

Please avoid to call Workbook.CalculateFormula method multiple times for it's a time consuming funciton. If you don't need to retrieve formula result at run time, you don't need to call Workbook.CalculateFormula method at all. When MS Excel opens your generated files, it will automatically recalculate formulas.