Hi All,
Does anyone know how I can create a sub menu off a custom menu in excel ?
Similar to File > Print Area > Set Print Area
Here is what I have at the moment......
Private Sub Worksheet_Activate()
Dim cbWSMenuBar As CommandBar
Dim muCustom As CommandBarControl
Dim iHelpIndex As Integer
Set cbWSMenuBar = CommandBars("Worksheet Menu Bar")
iHelpIndex = cbWSMenuBar.Controls("Help").Index
Set muCustom = cbWSMenuBar.Controls.Add(Type:=msoControlPopup, Before:=iHelpIndex, Temporary:=True)
With muCustom
.Caption = "&Promise Finance Options"
With .Controls.Add(Type:=msoControlButton)
.Caption = "&Month Lookup"
.BeginGroup = True
.OnAction = "Monthlookup"
End With
End With
End Sub
Thanx in advance for any help.
Rgds, John
Does anyone know how I can create a sub menu off a custom menu in excel ?
Similar to File > Print Area > Set Print Area
Here is what I have at the moment......
Private Sub Worksheet_Activate()
Dim cbWSMenuBar As CommandBar
Dim muCustom As CommandBarControl
Dim iHelpIndex As Integer
Set cbWSMenuBar = CommandBars("Worksheet Menu Bar")
iHelpIndex = cbWSMenuBar.Controls("Help").Index
Set muCustom = cbWSMenuBar.Controls.Add(Type:=msoControlPopup, Before:=iHelpIndex, Temporary:=True)
With muCustom
.Caption = "&Promise Finance Options"
With .Controls.Add(Type:=msoControlButton)
.Caption = "&Month Lookup"
.BeginGroup = True
.OnAction = "Monthlookup"
End With
End With
End Sub
Thanx in advance for any help.
Rgds, John