给你一段代码,自己看吧.(我提的问题连看的人都没有,今天实在没兴趣呆下去了):
var
Excel: Variant;
oxlApp: Variant;
ExcelFileName: string;
begin
//提示等待ShowProgress
Screen.Cursor := crHourGlass;
try
ExcelFileName := 'c:/book1.xls';
Screen.Cursor := crHourGlass;
//创建Excel,并打开对应的Excel模板文件.注意这里只是创建,并不显示出来,
try
Excel := CreateOleObject('excel.application');
Excel.Workbooks.Open(ExcelFileName);
except {3953, "不能创建Excel对象,请确认是否已经正常安装Excel!"}
raise Exception.Create(LoadStr(3953));
end;
oxlApp := Excel.WorkSheets[1];
oxlApp.Cells.Item[1, 1].Select;
oxlApp.copy;
img1.Picture.Assign(Clipboard);
Excel.Visible := True;
finally
Screen.Cursor := crDefault;
end;
end;