D2007: .Calculate does not flag xlsx file as "calculated"
Posted: Mon Jul 04, 2016 12:35 pm
Hi Lars,
in versions older than 5.20.23 , there was this problem with a file with formulas:
1) perform the "XLSReadWriteII51.Calculate;" before writing
2) open the file with Excel
3) close the file without touching it : a message appears "do you want to save the changes made to file .... ?"
that means the formulas are calculated in that time and not when we force to calculate them in point 1).
Now in the latest versions, >= 5.20.53 and in the actual 5.20.77 , it is not working again.
Latest working version is 5.20.41
Let me know, thanks
Massimo
procedure TForm2.Button1Click(Sender: TObject);
begin
XLSReadWriteII51.Filename := 'c:\test1.xlsx';
XLSReadWriteII51[0].Columns.AddIfNone(0,20);
XLSReadWriteII51[0].Name := 'TEST1';
XLSReadWriteII51[0].AsInteger[1,1] := 1;
XLSReadWriteII51[0].AsInteger[1,2] := 3;
XLSReadWriteII51[0].AsFormula[1,3] := 'SUM(B2:B3)';
XLSReadWriteII51.Calculate;
// I also tried to force calculate of single cell but it is the same....
//XLSReadWriteII51[0].Calculate(1,3);
XLSReadWriteII51.Write;
end;
in versions older than 5.20.23 , there was this problem with a file with formulas:
1) perform the "XLSReadWriteII51.Calculate;" before writing
2) open the file with Excel
3) close the file without touching it : a message appears "do you want to save the changes made to file .... ?"
that means the formulas are calculated in that time and not when we force to calculate them in point 1).
Now in the latest versions, >= 5.20.53 and in the actual 5.20.77 , it is not working again.
Latest working version is 5.20.41
Let me know, thanks
Massimo
procedure TForm2.Button1Click(Sender: TObject);
begin
XLSReadWriteII51.Filename := 'c:\test1.xlsx';
XLSReadWriteII51[0].Columns.AddIfNone(0,20);
XLSReadWriteII51[0].Name := 'TEST1';
XLSReadWriteII51[0].AsInteger[1,1] := 1;
XLSReadWriteII51[0].AsInteger[1,2] := 3;
XLSReadWriteII51[0].AsFormula[1,3] := 'SUM(B2:B3)';
XLSReadWriteII51.Calculate;
// I also tried to force calculate of single cell but it is the same....
//XLSReadWriteII51[0].Calculate(1,3);
XLSReadWriteII51.Write;
end;