Is it possible to reference another spreadsheet in a formula? I've tried the following code and all I get are zeroes (no formula) in sheet '2'...
var
NewSheet: TSheet;
X: Integer;
FormStr: String;
begin
XLSRWMain.Filename:='C:\Test.xlsx';
XLSRWMain.Sheets.Clear;
NewSheet:=XLSRWMain.Sheet[0];
NewSheet.Name:='1';
for X:=1 to 10 do
begin
NewSheet.AsInteger[0,X]:=X;
end;
NewSheet:=XLSRWMain.Sheets.Add(wtSheet);
NewSheet.Name:='2';
for X:=1 to 10 do
begin
FormStr:='SUM(''1''!A' + IntToStr(X) + '*2)';
NewSheet.AsFormula[0,X]:=FormStr;
end;
XLSRWMain.Write;
end;
I have inserted a Showmessage routine to show the value of FormStr before setting the formula value in the cell and everything looks correct, but my results in the sheet titled '2' are all zeroes...
Reference another spreadsheet in a formula
Re: Reference another spreadsheet in a formula
Hello
This shall be fixed in the last update. Please download it and try again.
This shall be fixed in the last update. Please download it and try again.
Lars Arvidsson, Axolot Data
Re: Reference another spreadsheet in a formula
Will do - thanks!