473,409 Members | 2,057 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,409 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 5311
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!
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.