Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check for open workbook


howdy all
this should be relatively simple, i'm just not sure how to do it

i have 2 workbooks A.xls and B.xls

when i open A.xls, i want it to check and see if B.xls is open
if B.xls is open, then do nothing
if B.xls is not open, then open B.xls

that's it
i'm just not sure how to set the code to do it
any help would be great :)
thank

--
georgi
-----------------------------------------------------------------------
georgio's Profile: http://www.excelforum.com/member.php...fo&userid=1644
View this thread: http://www.excelforum.com/showthread.php?threadid=31907

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Check for open workbook


On Error Resume Next
Set oWB2 = Workbooks("B.xls")
On Error GoTo 0
If oWB2 Is Nothing Then
MsgBox "Open workbook 2"
End If


--

HTH

RP
(remove nothere from the email address if mailing direct)


"georgio" wrote in message
...

howdy all
this should be relatively simple, i'm just not sure how to do it

i have 2 workbooks A.xls and B.xls

when i open A.xls, i want it to check and see if B.xls is open
if B.xls is open, then do nothing
if B.xls is not open, then open B.xls

that's it
i'm just not sure how to set the code to do it
any help would be great :)
thanks


--
georgio
------------------------------------------------------------------------
georgio's Profile:

http://www.excelforum.com/member.php...o&userid=16440
View this thread: http://www.excelforum.com/showthread...hreadid=319072



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Check for open workbook

I often open multiple workbooks by "referencing" them to the master workbook.

Open excel, go to macro and select VBA to open the VBA editor.

Then go to tools and click references and browse to your files.

"georgio" wrote:


howdy all
this should be relatively simple, i'm just not sure how to do it

i have 2 workbooks A.xls and B.xls

when i open A.xls, i want it to check and see if B.xls is open
if B.xls is open, then do nothing
if B.xls is not open, then open B.xls

that's it
i'm just not sure how to set the code to do it
any help would be great :)
thanks


--
georgio
------------------------------------------------------------------------
georgio's Profile: http://www.excelforum.com/member.php...o&userid=16440
View this thread: http://www.excelforum.com/showthread...hreadid=319072


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
VBA to check is someone else has a workbook open Jim K.[_2_] Excel Discussion (Misc queries) 2 August 29th 08 04:32 PM
If Then to check if a workbook is open Shawn Excel Discussion (Misc queries) 5 November 25th 06 04:29 PM
Check if workbook open dkipping Excel Discussion (Misc queries) 4 May 24th 06 02:00 PM


All times are GMT +1. The time now is 08:22 AM.

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

About Us

"It's about Microsoft Excel"