Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming, microsoft.public.office.developer.automation
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming, microsoft.public.office.developer.automation
external usenet poster
 
Posts: 78
Default 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   Report Post  
Posted to microsoft.public.excel.programming, microsoft.public.office.developer.automation
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel still running in task manager after closing the application Willem Excel Discussion (Misc queries) 0 December 5th 06 01:56 PM
Printing leaves EXCEL.EXE process in Task Manager eeidfn Excel Discussion (Misc queries) 1 February 28th 06 02:24 AM
Task Manager and Excel 2003 Mike Excel Discussion (Misc queries) 1 April 20th 05 10:40 PM
EXCEL keeps running in task manager Sam Excel Programming 4 January 22nd 04 11:17 AM
get the program id of an excel application from the task manager nikolaosk[_5_] Excel Programming 2 October 14th 03 03:06 PM


All times are GMT +1. The time now is 04:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"