T
tabet
Unregistered / Unconfirmed
GUEST, unregistred user!
假如报表打印预缆后,关闭预缆时候,EXCEL也要关闭,同时不能出现要求保存的对话框.
请问在finally中如何实现?谢谢.
try
if not qryDemen.Active then
exit;
ExcelApplication1.WorkBooks.Add(xlWBATWorksheet, 1);
aSheet := ExcelApplication1.Worksheets.Item[1];
ExcelApplication1.Visible[0]:=True;
aSheet.PrintPreview;
finally
//总要问"是否要保存"
ExcelApplication1.Disconnect;
ExcelApplication1.Quit;
end;
请问在finally中如何实现?谢谢.
try
if not qryDemen.Active then
exit;
ExcelApplication1.WorkBooks.Add(xlWBATWorksheet, 1);
aSheet := ExcelApplication1.Worksheets.Item[1];
ExcelApplication1.Visible[0]:=True;
aSheet.PrintPreview;
finally
//总要问"是否要保存"
ExcelApplication1.Disconnect;
ExcelApplication1.Quit;
end;