Detect If Excel is running using VBA

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..
 
T

TC

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
 
P

Patty O'Dors

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top