ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Menus with sub menus... (https://www.excelbanter.com/excel-programming/397097-menus-sub-menus.html)

Mark

Menus with sub menus...
 
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

Michael

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

--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"mark" wrote:

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


Mark

Menus with sub menus...
 
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.



"Michael" wrote:

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

--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"mark" wrote:

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



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com