Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming, microsoft.public.office.developer.automation
|
|||
|
|||
Scripting Excel - EXCEL.EXE refuses to leave task manager after .Quit and =Nothing?
I've done extensive searches on the web and newsgroups trying to
resolve this problem, and I've had no luck. I've seen and tried many suggestions, and none have worked. I'm trying to create an Excel object using VB within IE (I've also tried javascript with forced garbage collection with no luck). THE PROBLEM: After closing Excel, the EXCEL.EXE task hangs around in the task manager forever, until I kill it. Since I'll be generating multiple excel instances, this will be unacceptable. I need to figure out how to actually close excel correctly. Here is a test case: http://www.mattkruse.com/temp/excel_automation.html (obviously, to run the test case, you need to allow activeX and scripting) When running this, the first option works correctly - it creates the object, closes it, and EXCEL.EXE goes away. But when a workbook is opened in the second test, EXCEL.EXE fails to go away. I am using Excel 2000 and Windows XP, if that makes any difference. Can anyone suggest things to try to force EXCEL.EXE to close? Or even better, modify the code in my example test case so that it works correctly? Thanks! Matt Kruse http://www.mattkruse.com/ |
#2
Posted to microsoft.public.excel.programming, microsoft.public.office.developer.automation
|
|||
|
|||
Scripting Excel - EXCEL.EXE refuses to leave task manager after .Quit and =Nothing?
Pl you post your script code here.
Regards, Matt wrote: I've done extensive searches on the web and newsgroups trying to resolve this problem, and I've had no luck. I've seen and tried many suggestions, and none have worked. I'm trying to create an Excel object using VB within IE (I've also tried javascript with forced garbage collection with no luck). THE PROBLEM: After closing Excel, the EXCEL.EXE task hangs around in the task manager forever, until I kill it. Since I'll be generating multiple excel instances, this will be unacceptable. I need to figure out how to actually close excel correctly. Here is a test case: http://www.mattkruse.com/temp/excel_automation.html (obviously, to run the test case, you need to allow activeX and scripting) When running this, the first option works correctly - it creates the object, closes it, and EXCEL.EXE goes away. But when a workbook is opened in the second test, EXCEL.EXE fails to go away. I am using Excel 2000 and Windows XP, if that makes any difference. Can anyone suggest things to try to force EXCEL.EXE to close? Or even better, modify the code in my example test case so that it works correctly? Thanks! Matt Kruse http://www.mattkruse.com/ |
#3
Posted to microsoft.public.excel.programming, microsoft.public.office.developer.automation
|
|||
|
|||
Scripting Excel - EXCEL.EXE refuses to leave task manager after .Quit and =Nothing?
The example URL has all the source, but here it is also:
Function generateExcel(openDoc) Dim excel msgbox("Ready to create Excel.Application") Set excel = CreateObject("Excel.Application") msgbox("Excel.Application created - you should now see EXCEL.EXE in your task manager") if (openDoc) then msgbox("Ready to open XLS file") excel.Workbooks.Open("http://www.mattkruse.com/temp/test.xls") msgbox("Workbook opened") msgbox("Ready to close workbook") excel.Workbooks.Item(1).Close msgbox("Workbook closed") end if msgbox("Ready to Quit Excel") excel.Quit msgbox("Excel quit") msgbox("Ready to set excel object to Nothing") Set excel = Nothing msgbox("Set to nothing") msgbox("EXCEL.EXE should now disappear from task manager - but if the workbook was opened, it doesn't!") End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel still running in task manager after closing the application | Excel Discussion (Misc queries) | |||
Printing leaves EXCEL.EXE process in Task Manager | Excel Discussion (Misc queries) | |||
Task Manager and Excel 2003 | Excel Discussion (Misc queries) | |||
EXCEL keeps running in task manager | Excel Programming | |||
get the program id of an excel application from the task manager | Excel Programming |