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 simple expression.

Val := Workbook.Calculate('100/2*3');
This example determines the smallest value in a range A1:F10 on active Worksheet.

Val := Workbook.Calculate('MIN(A1:F10)');
This example is the same to previous.

Val := Workbook.ActiveSheet.Calculate('MIN(A1:F10)');
Copyright©2007-2019 loslab.com