Hallo Jim
these are my procedure to open and close Excel.
...
private
FLCID : Integer;
...
procedure TExcelExportator.OpenExcel;
begin
With FSystemDataProvider.DatabaseConnector do
begin
ExcelApp.Connect;
ExcelApp.UserControl := False;
ExcelApp.Visible[FLCID] := False;
ExcelApp.DisplayAlerts[FLCID]:=False;
ExcelApp.AskToUpdateLinks[FLCID]:=False;
end;
end;
// Attention set ExcelApp.UserControl always like ExcelApp.Visible[FLCID];
procedure TForm1.CloseExcel;
begin
With FSystemDataProvider.DatabaseConnector do
begin
Excelsheet.Disconnect;
ExcelWorkbook.Disconnect;
ExcelApp.AskToUpdateLinks[FLCID]:=True;
ExcelApp.Quit;
ExcelApp.Disconnect;
end;
end;
-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Im Auftrag von Jim Burns
Gesendet: Dienstag, 26. April 2005 18:55
An: Delphi Talk
Betreff: Excel Automation
Hi all,
Ok, more on this excel automation. I have things working for the most part
and here's the general framework,
I'm using 2K Server controls with D7 (Thanks Jens),
appExcel : TExcelApplication;
excelWBook: TExcelWorkbook;
I'm simply trying to automate excel, open a workbook, and print it,
appExcel.Connect;
appExcel.Workbooks.Open(xlDoc, ovUpdate, EmptyParam, ... , 0);
excelWBook.ConnectTo(appExcel.ActiveWorkbook);
excelWBook.PrintOut(NULL, NULL, 1, ovFalse, 0, ovFalse, ovFalse,
EmptyParam, 0);
excelWBook.Close(ovFalse);
appExcel.Disconnect;
appExcel.Quit;
And for most workbooks this works fine. But, I still see an excel process
running in the background after my app goes idle. It does get closed when
my app closes.
Does it make sense that an excel process remains running after calling
appExcel.Quit?
Am I handling this right and is there no way or reason to insure the excel
process is closed directly?
Thanks,
------------------------------------------------------------------------
Jim Burns, <mailto:[EMAIL PROTECTED]>
Technology Dynamics
Pearland, Texas USA
281 485-0410 / 281 813-6939
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk