NativeExcel suite v2.x

Calculate method

Calculates the result of specified expression.

Syntax

function Calculate(Expression: WideString):Variant;
ExpressionWideString. A string that specifies an expression which should be calculated.

Example

This example calculates the sum of values in a range A1:A20
Val := Workbook.Sheets[1].Calculate('SUM(A1:A20)');
This example determines the smallest value in a range A1:F10 on worksheet one.
Val := Workbook.Sheets[1].Calculate('MIN(A1:F10)');
Copyright © NikaSoft 2004-2010