[]
Represents the options related to formula calculation, performance, and error handling.
Use this interface to configure workbook-level formula behavior, such as iterative calculation and its related limits. Obtain an instance from Formulas.
public interface IFormulaOptions
Public Interface IFormulaOptions
IFormulaOptions formulaOptions = workbook.Options.Formulas;
formulaOptions.EnableIterativeCalculation = true;
formulaOptions.MaximumIterations = 2;
IWorksheet sheet = workbook.ActiveSheet;
sheet.Range["B1"].Formula = "=A1+1";
sheet.Range["C1"].Formula = "=B1+1";
sheet.Range["D1"].Formula = "=C1+1";
sheet.Range["A1"].Formula = "=D1+1";
object value = sheet.Range["A1"].Value;
| Name | Description |
|---|---|
| CalculationMode | Gets or sets the calculation mode stored in the exported workbook. |
| EnableIterativeCalculation | Gets or sets whether iterative calculation is enabled for formulas with circular references. When enabled, the workbook iteratively calculates formulas that contain circular references until the maximum number of iterations or maximum error threshold is reached. |
| MaximumChange | Gets or sets the maximum error for iterative calculation. During iterative calculation, this value specifies the maximum difference allowed between the results of two consecutive iterations. Iteration stops when the difference is less than this value. |
| MaximumIterations | Gets or sets the maximum iterations of iterative calculation. When iterative calculation is enabled, formulas are recalculated until the maximum number of iterations is reached or the maximum error threshold is met. |