473,542 Members | 16,240 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5318
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
3696
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 problems. 1) I have hyperlinks in some tables and when I try to access the hyperlinks I get an error message "An unexpected error has occurred. ...
12
5506
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 and office XP components installed. ie I have word/access/excel 2k/xp/2003 installed. I tried to do a usual access 2k to word 2k automation yet I get...
9
2315
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 relevant. The code I use is Private Sub Cmdstart_Click() On Error GoTo Err_Handler Dim strPath As String If IsNull(DocURLtxt.Value) Then strmsg =...
8
2741
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 hoping to Brain Scrape some info from those of you that have. Schema: MS Access 2000 .adp sitting on a Terminal Server with SQL Server Database...
8
3354
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 process this .txt file. Goal: I am working on a vba script to:
1
3592
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 task manager and I'm unable to open the spreadsheet without first closing down Access. Can anyone help!? Dave Public Function...
12
3202
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 left running until my application closes. I have tried setting my Excel.Application object to Nothing. I have tried to then fore the GC into...
9
39375
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 ticked for the application you want to Automate. Set up an application object variable to use (You can use With...End With if you prefer). Either : ...
12
3780
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
7384
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7718
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7662
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5861
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5237
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3377
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.