Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Determine if a workbook is already open

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Determine if a workbook is already open

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.

--
Regards,
Tom Ogilvy

" wrote in
message ...
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.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Determine if a workbook is already open

THanks for the quick response

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

"Tom Ogilvy" wrote:

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.

--
Regards,
Tom Ogilvy

" wrote in
message ...
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.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Determine if a workbook is already 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

--
Regards,
Tom Ogilvy


" wrote in
message ...
THanks for the quick response

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

open
at all"

"Tom Ogilvy" wrote:

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.

--
Regards,
Tom Ogilvy

" wrote in
message ...
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.







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Determine if a workbook is already open

Many thanks for the help

"Tom Ogilvy" wrote:


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

--
Regards,
Tom Ogilvy


" wrote in
message ...
THanks for the quick response

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

open
at all"

"Tom Ogilvy" wrote:

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.

--
Regards,
Tom Ogilvy

" wrote in
message ...
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.










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default Determine if a workbook is already open

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

" wrote:

Many thanks for the help

"Tom Ogilvy" wrote:


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

--
Regards,
Tom Ogilvy


" wrote in
message ...
THanks for the quick response

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

open
at all"

"Tom Ogilvy" wrote:

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.

--
Regards,
Tom Ogilvy

" wrote in
message ...
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.








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Determine if a workbook is already open

Hi Tom,

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

Thank you.
--
Jac Tremblay


"Tom Ogilvy" wrote:


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

--
Regards,
Tom Ogilvy


" wrote in
message ...
THanks for the quick response

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

open
at all"

"Tom Ogilvy" wrote:

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.

--
Regards,
Tom Ogilvy

" wrote in
message ...
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.








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Open closed workbook/Search data tables/Return data to open workbook Hugh Adams Excel Discussion (Misc queries) 0 August 18th 10 02:04 PM
How can I determine who has workbook open? Dean Hinson[_3_] Excel Programming 3 April 20th 05 04:01 PM
Open JPG and determine pixel width in VB? Joe HM Excel Programming 5 March 25th 05 04:43 PM
Determine if a workbook is shared quartz Excel Programming 3 March 2nd 04 10:23 PM
Determine if Workbook is Open or Closed jurgenC![_2_] Excel Programming 2 December 28th 03 10:12 PM


All times are GMT +1. The time now is 08:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"