Detect If Excel is running using VBA

  • Thread starter Thread starter Winshent
  • Start date Start date
W

Winshent

How can i detect if excel is running from within Access 2000?

The machine i work on here has task manager locked so i simply cant
close down instances of excel when testing creation of workbooks..
 
Urk! Just use GetObject with the Excel progid:

dim oExcel as object
on error resume next
set oExcel = getobject (, "Excel.Application")
if err.number = 0 then msgbox "running!"
set oExcel = nothing

HTH,
TC
 
Let me guess - you're using the abominable GetObject to get a handle to an
Excel instance aren't you?...
Can I advise you- if you use CreateObject instead, you'll be sure that the
instance you create won't be used manually, as you can keep it invisible all
the time, that way, you'll not be getting rid of the the user's work when you
call Application.Quit.
 
Back
Top