创建自定义表名,结贴给分吧:
uses Excel2000, ComObj;
procedure TForm1.Button1Click(Sender: TObject);
var
ExcelApp: Variant;
begin
if not VarIsEmpty(ExcelApp) then
begin
ExcelApp.DisplayAlerts := False;
ExcelApp.Quit;
end;
try
ExcelApp := CreateOleObject('Excel.Application');
ExcelApp.Workbooks.Add(xlWBatWorkSheet);
ExcelApp.Workbooks[1].WorkSheets[1].Name := 'My INFO'; { 自定义表名 }
ExcelApp.WorkBooks[1].SaveAs( 'C:/Tmp.xls' ); { 保存文件 }
finally
ExcelApp.DisplayAlerts := False;
ExcelApp.Quit;
end;
end;