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: 12
Default Enabling/Disabling/Hiding/Unhiding Newly Created Menus and Submenu

I have asked this question somewhat less detailed than before but did not
successfully get a working answer. The problem is basic. I've created a
menu on the menu bar (My Menu) that is specific to the application I am
creating. Thus:

.... code above this and variable declarations. Loop through to setup the
menu on both the worksheet and chart sheets.

For MenuLoopCounter = 1 To 2


'----------------------------------------------------------------------------------------------------------------
' Add the MyMenu to the Menu Bar
Set MyMenu = CommandBars(MenuLoopCounter).Controls.Add _
(Type:=msoControlPopup, Temporary:=True)

'---------------------------------------------------------------
' Add the MyMenu title (a caption) to the Menu Bar
MyMenu.Caption = "MyMenu"


'-------------------------------------------------------------------------
' Add MyMenu List Item for the Estimate Worksheet
Set MyMenuItem = MyMenu.Controls.Add(Type:=msoControlButton)
With MyMenuItem
.Caption = "Estimate"
.OnAction = "Macro1"
End With

.... more code here.


' .................................................. ...
' Add MyMenu List Item
' .................................................. ...
Set MyMenuItem = MyMenu.Controls.Add(Type:=msoControlButton)
With MyMenuItem
.Caption = "Submenu 1"
.OnAction = "Submenu1macro"
.Tag = "Sub1"
.Enabled = False
End With

.... even more code.

Now, I want to enable the Submenu 1 just when Sheet 4 is active and not any
other time. Or better yet, just show this submenu item when Sheet 4 is
active. Any help would be most appreciated. I am sure it is my not fully
qualifying the object.

Sincerely,

Bryan
 
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
Excel List submenu missing in XP, after reloading builtin menus Mark Excel Worksheet Functions 3 April 14th 07 11:07 PM
Userforms: Disabling - Enabling the X Lauri Excel Programming 4 May 12th 06 07:02 PM
Disabling and re-enabling the AutoFilter from VBA CFD[_6_] Excel Programming 7 October 17th 05 01:43 AM
Disabling/enabling events with a button created by code?? Simon Lloyd[_518_] Excel Programming 5 July 7th 04 12:09 PM
Enabling/Disabling Macros David Excel Programming 6 August 12th 03 06:21 PM


All times are GMT +1. The time now is 05:44 AM.

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"