Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default prevent second copy from opening

Basically, is there a way to check if a workbook with the
same name is already opened and if it is, do not try to
open a new instance.


You can't have two workbooks open with the same name.

You could have your workbook open event see if a version of the menu is
already present.

On error resume next
set obar = Commandbars("Worksheet Menu Bar").Controls("My Menu")
On Error goto 0
if obar is nothing then
' create the meny
End if



Regards,
Tom Ogilvy

"Derek" wrote in message
...
I have a workbook that uses the workbook_open event to
call a procedure to create a menu. When I try to open a
second instance of the workbook I get an error. It looks
like the second workbook is trying to create the menu
again (I am assuming there is a name conflict).

Basically, is there a way to check if a workbook with the
same name is already opened and if it is, do not try to
open a new instance.



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
prevent workbook opening if already open by someone else KevHardy Excel Discussion (Misc queries) 0 March 4th 10 10:02 AM
Prevent worksheet from opening in a workbook laurenm Excel Worksheet Functions 5 January 18th 07 05:42 AM
How to prevent any one from opening my workbook MMCM New Users to Excel 5 August 25th 06 07:54 PM
prevent second copy from opening pancho[_2_] Excel Programming 0 July 10th 03 07:41 PM


All times are GMT +1. The time now is 06:05 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"