Menus with sub menus...

G

Guest

Hi.

I'm trying to add a sub menu to a custom menu item, like on the Data menu
where the Filter item has three subs... Auto-Filter, Show All, and Advanced
Filter

I can add the Menu, and the first menu item, but haven't found where to then
add a list of things to the item created.

What is that next step?

Thanks,
Mark
 
G

Guest

You need something like this:
Set SubMenuItem = MenuItem.Controls.Add(Type:=msoControlButton)
With SubMenuItem
.Caption = "&Obtain Oracle Data"
.FaceId = 2109
.OnAction = "FullProcess"
End With
 
G

Guest

what I actuall needed was something like this:

'*****************
Sub sbAddKensReport()

'dimension variables

Dim cmdBar As CommandBar
Dim myCommand As CommandBarControl
Dim mySubCommand As CommandBarControl


'assign variables

Set cmdBar = CommandBars("Tools")
Set myCommand = cmdBar.Controls.Add(Type:=msoControlPopup)
Set mySubCommand = myCommand.Controls.Add


'assign captions

myCommand.Caption = "Ken's Report"
mySubCommand.Caption = "Run"


'assign program to run

With mySubCommand
.OnAction = ThisWorkbook.Name & "!" & "sbKen"
End With

End Sub
'*********************

That adds the menu type I was asking about, which is actually called a
popup, not a drop-down.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top