Method Evaluate
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
Evaluate(string, XlsxCalculationOptions?)
Calculates a formula against the sheet, as if it were in a cell of it, and writes it nowhere: its references read the cells' values as the workbook holds them.
public XlsxCellValue Evaluate(string formula, XlsxCalculationOptions? options = null)
Parameters
formulastringThe formula, with or without its
=, as Excel stores it.optionsXlsxCalculationOptionsThe bounds; null for the defaults.
Returns
- XlsxCellValue
The value: a number, text, a boolean, an error, or blank. A function this library does not calculate gives
#NAME?.
Exceptions
- ArgumentNullException
formulais null.- ArgumentException
The formula cannot be read.
- ResourceLimitExceededException
The calculation passes MaxSteps.