Formula is not being calculated in Excel
Posted: Mon Dec 01, 2014 2:30 pm
In the Excel file cell A1 must be the sum of A2:A5, but the result is 0 (zero).
And XLSReadWriteII51.Formulas.Calculate doesn't work.
Example code:
And XLSReadWriteII51.Formulas.Calculate doesn't work.
Example code:
Code: Select all
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
XLSReadWriteII51.FileName:='C:\XLSRW.xlsx';
XLSReadWriteII51.Sheets[0].AsFormula[0, 0]:='SUM(A2:A5)';
XLSReadWriteII51.Sheets[0].AsInteger[ 0, 1]:=1;
XLSReadWriteII51.Sheets[0].AsInteger[ 0, 2]:=2;
XLSReadWriteII51.Sheets[0].AsInteger[ 0, 3]:=3;
XLSReadWriteII51.Sheets[0].AsInteger[ 0, 4]:=4;
XLSReadWriteII51.Formulas.Calculate;
XLSReadWriteII51.Write;
end;