[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWorksheet.Evaluate2

Evaluate2 Method

Evaluate2(string)

Evaluates the specified Excel formula or named expression and returns the result.

The formula is evaluated by using dynamic array semantics.

Declaration
object Evaluate2(string formula)
Function Evaluate2(formula As String) As Object
Parameters
Type Name Description
string formula

A string containing an Excel formula, named range, or defined name to evaluate. A leading = is allowed. Must not be null or empty.

Returns
Type Description
object

The evaluated result.

Examples
worksheet.Range["A1"].Value = 1;
worksheet.Range["A2"].Value = 2;
worksheet.Range["A3"].Value = 2;
object result = worksheet.Evaluate2("=UNIQUE(A1:A3)");
Exceptions
Type Condition
InvalidFormulaException

if formula is null, empty, or not a valid formula expression.