全部博文(788)
分类:
2008-11-18 14:50:22
附代码:
MsExcel := CreateOleObject('Excel.Application');
WorkBook := MsExcel.Application;
filename:=trim(edit_filename.Text);
WorkBook.WorkBooks.Open(filename);
WorkBook.Visible := False;
WorkSheet:= WorkBook.ActiveSheet;
for i:=2 to WorkSheet.UsedRange.Rows.count do
begin
......
end;
执行完后,需要退出时
WorkBook.Quit;
使用完后直接ExcelOPen.Quit;就OK了 。如果有连接就先断开连接disconnectio然后再QUIT