HotXLS Delphi Excel Read Write Library / Component Developers Guide loslab Inc.

Calculate method

Calculates the result of specified expression.

Syntax

function Calculate(Expression: WideString):Variant;
Expression WideString. 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©2007-2019 loslab.com