View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default Excel already open test

Thanks Scott, I can see many uses for the function in automating Office
applications, but my problem is that I need to detect the Excel instance
before I load my application (also Excel).

--
Cheers
Nigel



"Nimrod" wrote in message
...
I use the code on the following link to check if Excel is currently

running
or not:

http://www.mvps.org/access/modules/mdl0006.htm

The link above shows automation of Excel, and includes a link to the
fISAppRunning module. I also found a need of the fIsAppRunning module to
keep my VBA routine in a loop until after an application closes so a

second
sheet would update BEFORE being imported into Access. It's nifty. Hope
this helps.

Scott


"Nigel" wrote in message
...
Hi All
I have an application that takes control of Excel. That works ok.
However
if the user already has Excel running, with or without an open workbook,
my
application which controls the menu and command bars also affect the
current
workbooks as well. to avoid this I need to detect if this situation

exists
as my application loads.

What I would like to do is as follows....

1. If an instance of Excel is running, then open another instance - do

not
use the current one. This is my preference as my application opens in

its
own environment and does not affect the current open workbooks.

2. If the above is not possible, provide a controlled shutdown of the
existing open workbook(s), asking the user to either save or close them.
If
their choice, on any open workbook, is 'No' then do not open my
application
and tell the user as much.

Is this possible?


--
Cheers
Nigel