LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Duplicate command bar control after opening 2nd workbook

All:

I use the following VBA code in the Workbook_Open procedure
to create a new dropdown menu named "TASS".

Set HelpMenu = Application.CommandBars(1).FindControl(ID:=30010)

If HelpMenu Is Nothing Then
Set myMenu = Application.CommandBars(1).Controls.Add _
(Type:=msoControlPopup, Temporary:=True)
Else
Set myMenu = Application.CommandBars(1).Controls.Add _
(Type:=msoControlPopup, Befo=HelpMenu.Index, Temporary:=True)
End If

With myMenu
.Caption = "&TASS"
End With

My problem is that everytime I open another Excel Workbook that
has this code, another identical "TASS" menu is created.

I would like to avoid this annoyance by somehow checking if the
"TASS" menu already exists before adding it.

Can anybody suggest a quick and simple way that I can check
if this menu already exists so that I don't add it again?

Respectfully,

Charles
 
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
Opening a workbook withAuto-open Macros without transferring control [email protected] Excel Programming 0 November 3rd 06 12:13 AM
duplicate data, if command in VBA VB123 Excel Programming 4 October 18th 05 04:17 PM
How to control worksheet initialization upon opening a workbook Nick Excel Worksheet Functions 3 October 31st 04 04:36 PM
How to make the opening of a workbook conditional upon the opening of another workbook Marcello do Guzman Excel Programming 1 December 16th 03 06:09 AM
How to make opening of workbook conditional of opening of another workbook turk5555[_2_] Excel Programming 2 December 15th 03 11:07 PM


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