A
agai
Unregistered / Unconfirmed
GUEST, unregistred user!
为什么最多只能有3个WorkSheet,向WorkSheets[4]插入数据时,报错'无效索引'
XLApp := CreateOleObject('Excel.Application');
XLApp.Visible := True;
XLApp.Workbooks.Add;
for i := 1 to 10 do begin
XLApp.Workbooks[1].Worksheets.Name := 'Delphi Data'+ IntToStr(i);
InsertData; //一个过程
end;
XLApp := CreateOleObject('Excel.Application');
XLApp.Visible := True;
XLApp.Workbooks.Add;
for i := 1 to 10 do begin
XLApp.Workbooks[1].Worksheets.Name := 'Delphi Data'+ IntToStr(i);
InsertData; //一个过程
end;