Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Determine if a workbook is already open

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hzgt9b@nopost.com - 11 Oct 2005 21:46 GMT
Using VBA in open Excel workbook I want to determine if a specific workbook
is already open. The complication is that multiple Excel processes may
already be open. What's the easiest way to do this?

I suppose what I'm really looking for is some way to iterate through all the
open excel applications that are running and interrogate them to see if one
matches the name that I am concened about...

Thanks in advance for any ideas.
Tom Ogilvy - 11 Oct 2005 22:05 GMT
There is no provision for iterating through instances of excel.  If you just
want to know if the file is open at all, you can determine that, but not by
iterating instances.  If you want to work with the open file in an unknown
instance, there is no provision for it.

Signature

Regards,
Tom Ogilvy

> Using VBA in open Excel workbook I want to determine if a specific workbook
> is already open. The complication is that multiple Excel processes may
[quoted text clipped - 5 lines]
>
> Thanks in advance for any ideas.
hzgt9b@nopost.com - 12 Oct 2005 13:28 GMT
THanks for the quick response

Ok, can you give me an example code snippet of "...know if the file is open
at all"

> There is no provision for iterating through instances of excel.  If you just
> want to know if the file is open at all, you can determine that, but not by
[quoted text clipped - 13 lines]
> >
> > Thanks in advance for any ideas.
Tom Ogilvy - 12 Oct 2005 14:45 GMT
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

Signature

Regards,
Tom Ogilvy

> THanks for the quick response
>
[quoted text clipped - 18 lines]
> > >
> > > Thanks in advance for any ideas.
hzgt9b@nopost.com - 12 Oct 2005 15:02 GMT
Many thanks for the help

> http://support.microsoft.com?kbid=138621
> XL: Macro Code to Check Whether a File Is Already Open
[quoted text clipped - 36 lines]
> > > >
> > > > Thanks in advance for any ideas.
Mats Samson - 01 Nov 2005 21:16 GMT
Hi,
I don't know if you already solved the matter but anyhow,
I use the following to check if the WB is open:

Sub OpenMyBook()
Dim bk As Workbook
On Error Resume Next
Set bk = Workbooks("MyBook1.xls")
On Error GoTo 0
If Not bk Is Nothing Then
  Workbooks("MyBook1").Activate
Else
 ChDir ("Path")
   Workbooks.Open ("MyBook1.xls")
End If
Workbooks("MyBook1").Activate
End Sub

Best regards
Mats

> Many thanks for the help
>
[quoted text clipped - 38 lines]
> > > > >
> > > > > Thanks in advance for any ideas.
Jac Tremblay - 28 Feb 2007 16:05 GMT
Hi Tom,

This post and your reply answered my question and solved my problem.

Thank you.
Signature

Jac Tremblay

> http://support.microsoft.com?kbid=138621
> XL: Macro Code to Check Whether a File Is Already Open
[quoted text clipped - 36 lines]
> > > >
> > > > Thanks in advance for any ideas.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.