Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2003 will not terminate with application.quit

When I use automation (VB, VBS, etc.) to open a workbook
in Excel 2003, the Quit method does not terminate the
Excel process. Each time the script is executed, another
Excel process is started, using about 10MB memory. I need
to use Task Manager to kill the process, lest I run out
of memory in a few days. Here is a sample script:

Dim XLApp
Dim XLWkb
Set XLApp = CreateObject("Excel.Application")
Set XLWkb = XLApp.Workbooks.Open("c:\xlbug.xls")
XLWkb.Close
Set XLWkb = Nothing
XLApp.Quit
Set XLApp = Nothing
'EXCEL.EXE should not be running anymore, but it is!

You can open any workbook file. I tested with a small
workbook file (two cells only) or a single-line text
file - same result. This problems does not happen with
Excel 2000.

Thanks,

Peter Schellenbach

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Excel 2003 will not terminate with application.quit

I tried your code as a .vbs script and excel closed for me.

In fact, I thought maybe there was a prompt waiting for you so the xlwkb.close
line was still waiting.

If you have a volatile function (like =today(), =now(), =rand()), then that
workbook will recalculate when you open it. And maybe excel was waiting for you
to answer the "The workbook has changed--do you want to save it?" prompt.

But that message popped up nice and clear when I tested. (You would have
noticed it.)

Maybe adding

xlapp.visible = true

to your script would help you find the problem.

(tested with winxp home and xl2003)



Peter Schellenbach wrote:

When I use automation (VB, VBS, etc.) to open a workbook
in Excel 2003, the Quit method does not terminate the
Excel process. Each time the script is executed, another
Excel process is started, using about 10MB memory. I need
to use Task Manager to kill the process, lest I run out
of memory in a few days. Here is a sample script:

Dim XLApp
Dim XLWkb
Set XLApp = CreateObject("Excel.Application")
Set XLWkb = XLApp.Workbooks.Open("c:\xlbug.xls")
XLWkb.Close
Set XLWkb = Nothing
XLApp.Quit
Set XLApp = Nothing
'EXCEL.EXE should not be running anymore, but it is!

You can open any workbook file. I tested with a small
workbook file (two cells only) or a single-line text
file - same result. This problems does not happen with
Excel 2000.

Thanks,

Peter Schellenbach


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Excel 2003 will not terminate with application.quit

Hi Peter,

I would suggest adding False as the first argument to the Close method:

XLWkb.Close False

If you don't do this, Excel may, as Dave mentioned, be waiting for you to
answer "do you want to save changes". Were these workbooks created with
Excel 2000? If so, that would explain what you're seeing. Excel 2000
workbooks will always prompt you to save upon close when they are opened in
Excel 2003.

But regardless of what's causing the problem, adding False is a good
practice.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Peter Schellenbach wrote:
When I use automation (VB, VBS, etc.) to open a workbook
in Excel 2003, the Quit method does not terminate the
Excel process. Each time the script is executed, another
Excel process is started, using about 10MB memory. I need
to use Task Manager to kill the process, lest I run out
of memory in a few days. Here is a sample script:

Dim XLApp
Dim XLWkb
Set XLApp = CreateObject("Excel.Application")
Set XLWkb = XLApp.Workbooks.Open("c:\xlbug.xls")
XLWkb.Close
Set XLWkb = Nothing
XLApp.Quit
Set XLApp = Nothing
'EXCEL.EXE should not be running anymore, but it is!

You can open any workbook file. I tested with a small
workbook file (two cells only) or a single-line text
file - same result. This problems does not happen with
Excel 2000.

Thanks,

Peter Schellenbach


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Excel 2003 will not terminate with application.quit

Unless you want to save those changes <vbg.

Jake Marx wrote:

Hi Peter,

I would suggest adding False as the first argument to the Close method:

XLWkb.Close False

If you don't do this, Excel may, as Dave mentioned, be waiting for you to
answer "do you want to save changes". Were these workbooks created with
Excel 2000? If so, that would explain what you're seeing. Excel 2000
workbooks will always prompt you to save upon close when they are opened in
Excel 2003.

But regardless of what's causing the problem, adding False is a good
practice.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

Peter Schellenbach wrote:
When I use automation (VB, VBS, etc.) to open a workbook
in Excel 2003, the Quit method does not terminate the
Excel process. Each time the script is executed, another
Excel process is started, using about 10MB memory. I need
to use Task Manager to kill the process, lest I run out
of memory in a few days. Here is a sample script:

Dim XLApp
Dim XLWkb
Set XLApp = CreateObject("Excel.Application")
Set XLWkb = XLApp.Workbooks.Open("c:\xlbug.xls")
XLWkb.Close
Set XLWkb = Nothing
XLApp.Quit
Set XLApp = Nothing
'EXCEL.EXE should not be running anymore, but it is!

You can open any workbook file. I tested with a small
workbook file (two cells only) or a single-line text
file - same result. This problems does not happen with
Excel 2000.

Thanks,

Peter Schellenbach


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Excel 2003 will not terminate with application.quit

Dave Peterson wrote:
I would suggest adding False as the first argument to the Close
method:

XLWkb.Close False


Unless you want to save those changes <vbg.


Good point. <g

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel 2003 will not terminate with application.quit

Thanks Dave & Jake

After reading your responses, I loaded up a fresh copy of XP Pro / SP2 and
Office 2003 / SP1 on a test computer and tried the same test script. No
problem. However on my main desktop system, Excel indeed does not terminate.
It does not show up in the Applications, but does show up in Processes, and
chews up 10-20MB each time the script is run. I have a customer reporting the
same problem, which is why I am investigating. I did try adding False to the
XLWkb.Close method, but no difference. I also added XLApp.Visible=True to see
if any unexpected dialogs popped up, but nothing showed up and the Excel
process still did not terminate.

I also ran msconfig and selected "diagnostic startup" just in case some
other program was interferring, but still no luck.

Any more ideas?

Thanks,

Peter

"Peter Schellenbach" wrote:

When I use automation (VB, VBS, etc.) to open a workbook
in Excel 2003, the Quit method does not terminate the
Excel process. Each time the script is executed, another
Excel process is started, using about 10MB memory. I need
to use Task Manager to kill the process, lest I run out
of memory in a few days. Here is a sample script:

Dim XLApp
Dim XLWkb
Set XLApp = CreateObject("Excel.Application")
Set XLWkb = XLApp.Workbooks.Open("c:\xlbug.xls")
XLWkb.Close
Set XLWkb = Nothing
XLApp.Quit
Set XLApp = Nothing
'EXCEL.EXE should not be running anymore, but it is!

You can open any workbook file. I tested with a small
workbook file (two cells only) or a single-line text
file - same result. This problems does not happen with
Excel 2000.

Thanks,

Peter Schellenbach

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Excel 2003 will not terminate with application.quit

The little sample script suffered from the same problem???

I don't have any other suggestions for that, but if that actually worked ok,
then maybe in the real script, you didn't release all your objects???

(But that's just one wild guess.)

Peter Schellenbach wrote:

Thanks Dave & Jake

After reading your responses, I loaded up a fresh copy of XP Pro / SP2 and
Office 2003 / SP1 on a test computer and tried the same test script. No
problem. However on my main desktop system, Excel indeed does not terminate.
It does not show up in the Applications, but does show up in Processes, and
chews up 10-20MB each time the script is run. I have a customer reporting the
same problem, which is why I am investigating. I did try adding False to the
XLWkb.Close method, but no difference. I also added XLApp.Visible=True to see
if any unexpected dialogs popped up, but nothing showed up and the Excel
process still did not terminate.

I also ran msconfig and selected "diagnostic startup" just in case some
other program was interferring, but still no luck.

Any more ideas?

Thanks,

Peter

"Peter Schellenbach" wrote:

When I use automation (VB, VBS, etc.) to open a workbook
in Excel 2003, the Quit method does not terminate the
Excel process. Each time the script is executed, another
Excel process is started, using about 10MB memory. I need
to use Task Manager to kill the process, lest I run out
of memory in a few days. Here is a sample script:

Dim XLApp
Dim XLWkb
Set XLApp = CreateObject("Excel.Application")
Set XLWkb = XLApp.Workbooks.Open("c:\xlbug.xls")
XLWkb.Close
Set XLWkb = Nothing
XLApp.Quit
Set XLApp = Nothing
'EXCEL.EXE should not be running anymore, but it is!

You can open any workbook file. I tested with a small
workbook file (two cells only) or a single-line text
file - same result. This problems does not happen with
Excel 2000.

Thanks,

Peter Schellenbach


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel 2003 will not terminate with application.quit

Hi Dave -

The little sample script suffered from the same problem???


Yes. That simple script was enough to keep Excel from terminating.

Looks like we found the problem. It appears that Google Desktop Search
Office AddIn somehow is getting a reference to the Excel object created by
the script, and never releases this reference. I uninstalled Google Desktop
Search and the problem is gone.

Thanks,

Peter

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Excel 2003 will not terminate with application.quit

I just installed Google Desktop yesterday.

I've seen lots of posts that complain about that program messing up Excel.

One of the suggested fixes is to do a registry tweak.

But you could try turning the google desktop back on, but turn off the COM addin
in excel (and Word and PPT??).

In excel,
Tools|customize|Commands tab|Tools Category
Scroll down the commands listbox and
Drag "COM Add-ins..." to under Tools|Addins
(It seems to make sense there.)

Then close up that dialog.

Back to Tools|COM Add-ins...
Turn off the google desktop search addin.

Maybe you can still use the desktop addin then.

====
PS. I read a few posts about google desktop causing trouble--but that was with
the beta version of the program. I guess Google just released it into
"production" recently.

Maybe the new version doesn't have this trouble. (Maybe a download of the most
current version would be in order for testing.)

Peter Schellenbach wrote:

Hi Dave -

The little sample script suffered from the same problem???


Yes. That simple script was enough to keep Excel from terminating.

Looks like we found the problem. It appears that Google Desktop Search
Office AddIn somehow is getting a reference to the Excel object created by
the script, and never releases this reference. I uninstalled Google Desktop
Search and the problem is gone.

Thanks,

Peter


--

Dave Peterson
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Excel 2003 will not terminate with application.quit

Ps. The registry tweak did the same as turning off that comaddin. (I find
going through menus safer than touching the registry.)

Dave Peterson wrote:

I just installed Google Desktop yesterday.

I've seen lots of posts that complain about that program messing up Excel.

One of the suggested fixes is to do a registry tweak.

But you could try turning the google desktop back on, but turn off the COM addin
in excel (and Word and PPT??).

In excel,
Tools|customize|Commands tab|Tools Category
Scroll down the commands listbox and
Drag "COM Add-ins..." to under Tools|Addins
(It seems to make sense there.)

Then close up that dialog.

Back to Tools|COM Add-ins...
Turn off the google desktop search addin.

Maybe you can still use the desktop addin then.

====
PS. I read a few posts about google desktop causing trouble--but that was with
the beta version of the program. I guess Google just released it into
"production" recently.

Maybe the new version doesn't have this trouble. (Maybe a download of the most
current version would be in order for testing.)

Peter Schellenbach wrote:

Hi Dave -

The little sample script suffered from the same problem???


Yes. That simple script was enough to keep Excel from terminating.

Looks like we found the problem. It appears that Google Desktop Search
Office AddIn somehow is getting a reference to the Excel object created by
the script, and never releases this reference. I uninstalled Google Desktop
Search and the problem is gone.

Thanks,

Peter


--

Dave Peterson


--

Dave Peterson


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2003 will not terminate with application.quit

I am experiencing the exact same problem, BUT I do not have the Googl
Desktop Search AddIn. I am seeing this on an XP Pro machine as well a
a W2K machine

Could there be any other addIns that can cause a similar symptom

Thanks
To

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Excel 2003 will not terminate with application.quit


"tedgar" wrote in message
...
I am experiencing the exact same problem, BUT I do not have the Google
Desktop Search AddIn. I am seeing this on an XP Pro machine as well as
a W2K machine.

Could there be any other addIns that can cause a similar symptom?

Thanks,
Tom


None that I'm aware of. It may make sense to create a minimal application
that simply starts Excel and the calls Quit followed by a release of the
refernec. It's possible that ther real program you have doesn't release all
the refernces it holds. If the minimal program works OK, you probably have
this kind of problem.

Best Regards,
Fredrik


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 application.quit in macro problem TimkenSteve New Users to Excel 3 August 17th 06 06:36 PM
Excel application does not quit Gena Excel Programming 0 October 29th 04 06:17 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
Excel 2003 and Application.Quit Dean[_6_] Excel Programming 6 June 22nd 04 06:05 PM
Macro to quit excel and go back to original application wendy Excel Programming 0 January 9th 04 08:22 PM


All times are GMT +1. The time now is 12:40 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"