var
xlApp:variant;
begin
xlApp:=CreateOleObject('Excel.Application');
.
.
.
xlApp.Quit;
xlApp:=unassinged;
endi write these code above,bug Excel can't terminated,why?
my excel is Excel2000
xlApp:variant;
begin
xlApp:=CreateOleObject('Excel.Application');
.
.
.
xlApp.Quit;
xlApp:=unassinged;
endi write these code above,bug Excel can't terminated,why?
my excel is Excel2000
{创建OLE对象:Excel Application与WorkBook}
ExlApp:=CreateOLEObject('Excel.Application');
ExlApp.DisplayAlerts := False;
Except
showMessage('您的机器里未安装Microsoft Excel');
Exit;
end;
ExlApp.Visible := true;
ExlApp.DisplayAlerts := False;
ExlApp.workBooks.Open(exl);
ExlApp.Workbooks[1].WorkSheets[1].PrintPreview;
exlapp.workbooks.close;
exlapp.quit;
ExlApp := unassinged;