I try to set reference in formula to another sheet but get error
My codeProject Project3.exe raised exception class XLSRWException with message 'Error in formula 'Sheet2'!B1
Unknown name Sheet2'.
Code: Select all
var
excel: TXLSReadWriteII5;
begin
excel := TXLSReadWriteII5.Create(nil);
excel.Version := xvExcel97;
excel.Add();
excel[1].Name := 'Sheet2';
excel[1].AsString[1, 1] := '1';
excel[0].AsFormula[0, 0] := 'Sheet2!B1';
excel[1].InsertColumns(0, 2);
excel.SaveToFile('e:\1.xls');
excel.Free();
end.
If I make file with cell Sheet1.A1 reference to Sheet2.B1 in Excel and open it with Axolot, i see in cell A1 formula "[ExternSheet]!B1".
And one more problem. If insert column A on Sheet2, formula in cell Sheet1.A1 is not udated.
Regards.
Anton.