View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Vba - Checking if running

If you want to see if the file is open:
http://support.microsoft.com?kbid=138621
XL: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=291295
XL2002: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=213383
XL2000: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=184982
WD97: VBA Function to Check If File or Document Is Open


if you want to see if it is open in the same instance of excel

Dim bk as Workbook
On Error Resume Next
set bk = Workbooks("Test.xls")
On Error goto 0
if not bk is nothing then
' Test.xls is open

If you mean something else, then perhaps you could provide a clearer
explanation.

--
Regards,
Tom Ogivy


"ajliaks " wrote in message
...
Hi all,

How can I check if excel application "Test.xls" is already runnig.
I need to run a macro which needs this book open, but it may be running
before macro activates itself.

must be something like:

aplication.running ("Test.xls") = true ...

Thanks,
Aldo.


---
Message posted from http://www.ExcelForum.com/