Open & Close Excel/Access cleanly (1 Viewer)

mark curtis

Registered User.
Local time
Today, 18:53
Joined
Oct 9, 2000
Messages
457
Dear all,

I am struggling to write the code that will firstly let me check if Excel is already open and if so then TransferSpreadsheet to that instance.

Also I want to open another database from my current database and then set the focus to the new database.

Any help or pointers please.

Thanks
Mark
 

ghudson

Registered User.
Local time
Today, 13:53
Joined
Jun 8, 2002
Messages
6,195
Check out Dev's "API: Find out if an application is currently running" http://www.mvps.org/access/api/api0007.htm
It will allow you to check if Excel is open and if so, set the focus to it.

The shell function is one way to open another db from your open db...
Call Shell("C:\Program Files\Microsoft Office\Office\msaccess.exe C:\Databases\Test.mdb", vbMaximizedFocus)

HTH
 

Sally

Registered User.
Local time
Today, 18:53
Joined
Feb 6, 2002
Messages
12
I am interested in this. I use the Shell call to start Word and run a macro stored in the normal template. Is it possible to check if Word is already open and just run the macro without opening another instance of Word if it is?
 

doulostheou

Registered User.
Local time
Today, 12:53
Joined
Feb 8, 2002
Messages
314
It appears that the code in these links tells you if excel is open. Is there a way to tell if a specific workbook is already open?
 

Users who are viewing this thread

Top Bottom