OLE-Excel

Hello!

I have found out, that this script leaves a running process named Excel in the Windows Taskmanager:

Variant Excel = CreateOleObject("Excel.Application");
Excel.Visible = true;
String ExcelFile = "d:\Lehrverpflichtung.xls"; // Pfad der ExcelDatei
Excel.Workbooks.Open(ExcelFile);
Variant Sheet = Excel.ActiveWorkbook.ActiveSheet;
Sheet.Cells.Item(1,1).Value = "Hello";
Excel.ActiveWorkbook.Save();
Excel.Workbooks.Close();
Excel.Quit();

The Quit function closes Excel, but in memory there is a Process EXCEL.EXE left.
I suppose, the OleObject is not destroyed, at the end of the Script.
A Bug or a feature?

Comments

  • edited 7:20PM
    It is normal. The same code in the Delphi (or BCB) clears the interface by _IntfClear call at the end of the method. I can't use _IntfClear - it is for internal use only and can't be accessed.
    FS leave one "Excel" process per application (independent from how many script you have executed). This process is terminated when you exit your application.
  • edited July 2004
    Thanks very much!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.