Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

close excel

0 views
Skip to first unread message

geebee

unread,
Dec 21, 2009, 9:21:01 PM12/21/09
to
hi,

i have a module in access which opens an excel file and runs a module
within the excel file. What is the best way to add code to the access module
to completely close excel and then close access. Because I noticed in the
task manager that excel is still running afterwards.


thanks i advance,
geebee

Douglas J. Steele

unread,
Dec 21, 2009, 9:43:59 PM12/21/09
to
Presumably you've instantiated some variable as an instance of
Excel.Application, using either

Dim objExcel As New Excel.Application

or

Dim objExcel As Excel.Application

Set objExcel = New Excel.Application

or

Dim objExcel As Object

Set objExcel = CreateObject("Excel.Application")

Once you're done with that object, you need to quit Excel, and set the
variable to Nothing:

objExcel.Application.Quit
Set objExcel = Nothing

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"geebee" <geral...@hotmail.com(noSPAMs)> wrote in message
news:BFE1098E-70C2-4079...@microsoft.com...

Arvin Meyer [MVP]

unread,
Dec 22, 2009, 6:00:41 PM12/22/09
to
Excel may be running because of an unclosed object that memory has failed
to release. Your code for late binding should look like:

Dim objXL As Object

' Do something in your code

objXL.Application.Quit
Set objXL = Nothing

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"geebee" <geral...@hotmail.com(noSPAMs)> wrote in message
news:BFE1098E-70C2-4079...@microsoft.com...

0 new messages