EXCEL still open !

fabio_prando

New Member
:confused:

Hi Everyone !

I developed a report using MS-EXCEL with COM-HANDLE.

My .p has a bug, because when it´s finished, excel is still open in memory.

I used de method CLOSE() for the workbooks, and RELEASE OBJECTS for all variables COM-HANDLE that I use in the program.

I´ve made some tests and realised that it only doesn´t work when the program execute the function COPY() of sheet object.

I´d like know what I must do to close the EXCEL !!

I bet in yours expiriences to help !!!

See You !

Fábio Prando
 

Jupiter

Member
Hi Guys I think I have a solution for the nagging "Excel Still Open" Problem.
This thread is 6 years old. I hope many of us have the solution by now. :awink:

Still...

The following code should do the trick. They must be written in given order.

chExcelApplication:Activewindow:CLOSE().
chExcelApplication:QUIT().
Release Object chExcelApplication.

Please give the user enough opportunity to save the file before closing it.

If we release the comhandle first and wait for the user to close the file, Excel is going to run in the background for ever because the background excel.exe is the parent of the still-opened excel file. On closing the child the OS has no clue that it should close the parent also.
 
Top