[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWorkbook.EnableCalculation

EnableCalculation Property

EnableCalculation

Gets or sets whether the calculation engine is enabled for the workbook.

When this property is false, formulas in the current workbook are no longer recalculated. If formula results are retrieved while calculation is disabled, the last calculated results from before calculation was disabled are returned.

This property is intended for large batch updates of values or formulas when updated calculation results are not needed until the batch is complete. Set this property to false before the batch to improve performance, and set it back to true when you need to calculate the workbook again.

Declaration
bool EnableCalculation { get; set; }
Property EnableCalculation As Boolean
Examples
worksheet.Range["A1"].Value = 1;
worksheet.Range["B1"].Formula = "=A1*2";
workbook.Calculate();
workbook.EnableCalculation = false;
worksheet.Range["A1"].Value = 10;
workbook.Calculate();
object value = worksheet.Range["B1"].Value;
bool enabled = workbook.EnableCalculation;