Table of Contents

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

formula string

The formula, with or without its =, as Excel stores it.

options XlsxCalculationOptions

The 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

formula is null.

ArgumentException

The formula cannot be read.

ResourceLimitExceededException

The calculation passes MaxSteps.