MIN formula Error

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
jjsverylong
Posts: 2
Joined: Thu Feb 11, 2010 6:39 am

MIN formula Error

Post by jjsverylong »

I coded as follows.

procedure TForm1.Button1Click(Sender: TObject);
var
loSheet: TSheet;
i: integer;
begin
xls.Filename := 'TestXls.xls';

loSheet := xls.Sheet[0];
loSheet.AsFloat[0,0] := 30;
loSheet.AsFloat[1,0] := 10;
loSheet.AsFloat[2,0] := 20;

loSheet.AsFormula[0, 1] := 'MIN(A1, B1)'; // this cell is OK

loSheet.AsFormula[0, 2] := 'MIN(A1-B1,C1)'; // this cell shows #VALUE error
xls.Write;
end;

After run and Click the button, Excel file is generated OK. But when I open that excel file from EXCEL,
Cell [0,2] shows #VALUE error.

What Is the problem?
Post Reply