473,289 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

In Access Automation, Instance of Excel cannot be destroyed.

I am running:
Win XP SP2
Excel 2002, Access 2002 (Office XP SP3)
Using Visual Basic (not VB.NET)

At one point (prior to XP SP2?!? - I can't pin it down), this did
not happen and I was easily able to destroy instances of excel (with
the exact same code). I have read many, many posts, and they seem to
get bogged down in specifics. So I cribbed this program from the
automation help file, simplified it further, so hopefully someone can
steer me to the root causes of this.

Two versions of code, one that works just fine, and the other that
leaves a hanging instance of excel that can only be removed by ending
the EXCEL.EXE process from the task manager.

Sub WorksFine()

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook

Set xlApp = CreateObject("Excel.Application")

xlApp.Visible = True

' It Seems to be the process of opening a workbook
' that is causing the problems
' -this also happens with
' xlbook = xlApp.Workbooks.Open("C:\Book1.xls))
'
' Set xlBook = xlApp.Workbooks.Add()
' xlBook.Worksheets(1).Cells(1, 1).Value = "Hello"
' xlBook.SaveAs "C:\Book1.xls"
' xlBook.Close
Set xlBook = Nothing

xlApp.Quit
Set xlApp = Nothing

End Sub
This next sub leaves an instance of excel hanging in the background.
This instance can be made visible by typing
"Excel.Application.Visible=True" in the immediate window.
However, "Excel.Application.Quit" in the immediate windown merely
returns it to its invisible status- does not remove EXCEL.EXE from the
list of processes.

Sub WhatTheHeck()

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook

Set xlApp = CreateObject("Excel.Application")

xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Add()
xlBook.Worksheets(1).Cells(1, 1).Value = "Hello"
xlBook.SaveAs "C:\Book1.xls"
xlBook.Close
Set xlBook = Nothing

xlApp.Quit
Set xlApp = Nothing

End Sub

I have come across many suggestions, but none seem to be applicable.

The symptoms are described in several kb articles.
This one describes the symptoms quite well:
XL2000: Automation Doesn't Release Excel Object from Memory
http://support.microsoft.com/default...b;en-us;199219
Thanks for any help!

Taylor

Nov 13 '05 #1
7 5304
On 18 Jan 2005 19:59:52 -0800, ta***********@gmail.com wrote:
I am running:
Win XP SP2
Excel 2002, Access 2002 (Office XP SP3)
Using Visual Basic (not VB.NET)

At one point (prior to XP SP2?!? - I can't pin it down), this did
not happen and I was easily able to destroy instances of excel (with
the exact same code). I have read many, many posts, and they seem to
get bogged down in specifics. So I cribbed this program from the
automation help file, simplified it further, so hopefully someone can
steer me to the root causes of this.

Two versions of code, one that works just fine, and the other that
leaves a hanging instance of excel that can only be removed by ending
the EXCEL.EXE process from the task manager.

Sub WorksFine()

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook

Set xlApp = CreateObject("Excel.Application")

xlApp.Visible = True

' It Seems to be the process of opening a workbook
' that is causing the problems
' -this also happens with
' xlbook = xlApp.Workbooks.Open("C:\Book1.xls))
'
' Set xlBook = xlApp.Workbooks.Add()
' xlBook.Worksheets(1).Cells(1, 1).Value = "Hello"
' xlBook.SaveAs "C:\Book1.xls"
' xlBook.Close
Set xlBook = Nothing

xlApp.Quit
Set xlApp = Nothing

End Sub
This next sub leaves an instance of excel hanging in the background.
This instance can be made visible by typing
"Excel.Application.Visible=True" in the immediate window.
However, "Excel.Application.Quit" in the immediate windown merely
returns it to its invisible status- does not remove EXCEL.EXE from the
list of processes.

Sub WhatTheHeck()

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook

Set xlApp = CreateObject("Excel.Application")

xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Add()
xlBook.Worksheets(1).Cells(1, 1).Value = "Hello"
xlBook.SaveAs "C:\Book1.xls"
xlBook.Close
Set xlBook = Nothing

xlApp.Quit
Set xlApp = Nothing

End Sub

I have come across many suggestions, but none seem to be applicable.

The symptoms are described in several kb articles.
This one describes the symptoms quite well:
XL2000: Automation Doesn't Release Excel Object from Memory
http://support.microsoft.com/default...b;en-us;199219
Thanks for any help!

Taylor

Hi

Try not declaring xLBook but writing out everything in full on each
line, that way you avoid creating any more references for automation
to lose track of.
Just an idea
David

Nov 13 '05 #2
I'll give it a shot and let you know.

Nov 13 '05 #3
I tried everything, and it was all very frustrating and getting out of
hand- Until I stumbled across another post (so easy to miss) wherein a
person commented that they had initiated a tech support session with
microsoft based on the similar problem, and they had tracked it down to
Google Desktop!

He uninstalled, it went away. I uninstalled my Google desktop, lo and
behold Ta Daa! I can kill instances at will!

Yay, thanks for the suggestions.

Taylor

P.S. I am not sure of the protocol for linking, but here is a cut n'
paste of his response:
Microsoft analyzed this for me and determined
that the problem was caused by the Google Desktop
Search Office Addin: A COM add-in is initially loaded
and assigns the reference to Excel or one of its
members to a global object, the reference isn't
released so Excel continues to be a loaded process.
This is what is happening when Google Desktop Search
tool is installed. This tool doesn't release the
object reference to the document (workbook).

I uninstalled Google Desktop Search and the problem
went away.

I have provided this description to Google Desktop Feedback.


Nov 13 '05 #4

THANK YOU! THANK YOU! THANK YOU!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5

THANK YOU! THANK YOU! THANK YOU!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #6
I am saved! May the fleas of a thousand camels infest your enemies'
testicles!!!!

I just had the same problem on a client's Windows XP computer (Access
2K). Tried for 2+ hours to unhang that danged instance, with no luck.
After reading your post, I just tried the same code on my own Windows
XP/Access 2K machine and Excel instance did NOT hang.

I am 99.99999% sure my client doesn't have Google desktop on that
machine (installing something like that is a firing-squad offense at
the company), so I don't think it's just Google. Will compare Windows
settings tomorrow to see what the difference is.

Thank you, thank you, thank you.

Krysa

Nov 13 '05 #7
This just in.... When I had the tech support folks update my client's
PC with Office Service Pack 3, the problem disappeared. We're not 100%
sure it was this Service Pack, because they also installed a number of
Windows XP updates (not SP-2, though) at the same time, but it would
seem the Office service pack is the more likely candidate.

I might note that Microsoft's suggestion not to use the "With"
structure (see KB 199299 link in original poster's message) did not
solve the problem.

So go forth and update!

Cheers,

Krysa

Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ecohouse | last post by:
I have a computer with XP on it. I loaded Office 97 first because I needed Access 97 for some work. I then loaded Office 2000. Everything seemed to be running fine. But I have come across a few...
12
by: Cheval | last post by:
Has anyone had any problems with inter-office automation between MS Word and MS Access in Office 2003? I have recently installed office 2003 in a new folder and have left the older office 2000...
9
by: Tony Williams | last post by:
I have an Access database that we use as a document index system. The documents can be Word, Excel, pdf's etc I have a command button on a form that opens the document in whatever program is...
8
by: Henry Craven | last post by:
Hi Everyone.. Been forever since I've posted to the Access newsgroups, and even longer since I've needed to post a question, but I've never had to use or try Access on a Terminal Server so I'm...
8
by: mytfein | last post by:
Hi Everyone, Background: Another department intends to ftp a .txt file from the mainframe, for me to process. The objective is to write a vb script that would be scheduled to run daily to...
1
by: u7djo | last post by:
Hi, I'm currently building a function in Access that creates an Excel spreadsheet but it doesn't look like the Excel object is being destroyed correctly as the Excel module is still showing in the...
12
by: elziko | last post by:
I'm using late binding (I must) to automate Excel. My code opens Excel after createing and poulating some sheets. My problem is that when the user finally decides to close Excel its process is...
9
NeoPa
by: NeoPa | last post by:
In VBA (I expect VB would be similar) controlling another Office Application (Automation) can be done using the following steps : Ensure the Reference (VBA Window / Tools / References) has been...
12
by: slinky | last post by:
Can an Excel spreadsheet or a section of one be embedded into an Access form and serve as a subform from which other parts of the Access form can get data? Thanks!
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.