EvaluateFormula Method
Evaluates the specified formula.
Syntax
[VB.NET] Public Function EvaluateFormula(ByVal Formula As String) As String
[C#] public string EvaluateFormula(string formula);
Remarks
This method evaluates the formula specified by Formula and returns the result.
This provide a way to directly calculate the result of a formula without setting CellFormula and calling Recalculate.
For instance:
ExcelDoc1.Cell = "A1"; ExcelDoc1.CellValue = "2"; ExcelDoc1.Cell = "A2"; ExcelDoc1.CellValue = "4"; String result = ExcelDoc1.EvaluateFormula("SUM(A1,A2)");NOTE: This method has a corresponding asynchronous version (EvaluateFormulaAsync) for use in the WinRT environment.