T
Type of Sheet displayed
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
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