Good morning everyone,
After I wanted to transfer my Lazarus project (created with 2.0.10), which has grown over time, to the current Lazarus version, the following code for creating Excel documents no longer works.
Code Listed here very simply:
procedure TForm1.ToggleBox1Change(Sender: TObject);
var
Range: olevariant;
arrData: olevariant;
x : integer;
varXLApp: olevariant;
varXLWb: olevariant;
begin
arrData := VarArrayCreate([1, 10, 1, 10], varVariant);
for x := 1 to 10 do
begin
arrData[x, x ] := UTF8ToUTF16('Test');
end;
varXLApp := CreateOleObject('Excel.Application');
varXLWb := varXLApp.Workbooks.Add;
Range :=varXLWb.WorkSheets[1].Range[varXLWb.WorkSheets[1].Cells[1, 1],varXLWb.WorkSheets[1].Cells[10, 10]];
Range.Value := arrData;
varXLApp.Visible := True;
end;
The error occurs at this point:
EOleSysError: “Member not found”
As of Lazarus 2.0.12 something has changed there.
Before that it worked without any problems.
Before I have to deal with fpspreadsheet or another type of Excel export...can someone help me get my old code running?
Thanks and Regards
Sasha