我的源程序如下:
var
ExcelApp:variant;
string1:string;
begin
try
ExcelApp := CreateOleObject('excel.Application');
Except
Messagedlg('Excel2000 Not Setup!',mtError,[mbYes],0);
Abort;
end;
Excelapp.Caption:='Toshiba Report Program';
string1:=ExtractFilePath(paramstr(0))+'excelb.xls';
Excelapp.workbooks.open(string1);
Excelapp.Visible:=true;
excelapp.worksheets.add;
ExcelApp.sheets['sheet0'].activate;
// excelapp.sheets['sheet0'].copy;会重新开一个工作薄,我想在同一个工作薄中
// ExcelApp.sheets['sheet1'].activate;
// excelapp.sheets['sheet1'].paste;
excelapp.Worksheets.Copy('sheet0','sheet1');;
// Excelapp.activesheet.printpreview;
end;