Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default More than one level of sub menus under the menu item

I'm wanting to add more than just one level of submenus to my special menu
created for my new Excel application. I know how to do this:

Menu Item 1
Menu Item 2
|
-- Submenu Item 1
-- Submenu Item 2
...
-- Submenu Item N
Menu Item 3

and so on. What I want to be able to do is:

Menu Item 1
Menu Item 2
|
-- Submenu Item 1
|
-- SubSubmenu Item 1
-- SubSubmenu Item 2
|
-- SubSubSubMenu Item 1
-- Submenu Item 2
...
-- Submenu Item N
Menu Item 3

Now that might not make sense to the most casual observer but I've added
many levels of print functionality on my dictator application and it does
make sense for printing out a range of charts/worksheets or selected ones.

Anyone know how to do this in VBA?

Sincerely,

Bryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default More than one level of sub menus under the menu item

http://j-walk.com/ss/excel/tips/tip53.htm

--
Regards,
Tom Ogilvy


"Bryan44" wrote in message
...
I'm wanting to add more than just one level of submenus to my special menu
created for my new Excel application. I know how to do this:

Menu Item 1
Menu Item 2
|
-- Submenu Item 1
-- Submenu Item 2
...
-- Submenu Item N
Menu Item 3

and so on. What I want to be able to do is:

Menu Item 1
Menu Item 2
|
-- Submenu Item 1
|
-- SubSubmenu Item 1
-- SubSubmenu Item 2
|
-- SubSubSubMenu Item 1
-- Submenu Item 2
...
-- Submenu Item N
Menu Item 3

Now that might not make sense to the most casual observer but I've added
many levels of print functionality on my dictator application and it does
make sense for printing out a range of charts/worksheets or selected ones.

Anyone know how to do this in VBA?

Sincerely,

Bryan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default More than one level of sub menus under the menu item

Here is an example that append to the Tools menu

Sub MultiLevelMenus()
Dim oCb As CommandBar
Dim oCtl1 As CommandBarPopup
Dim oCtl2 As CommandBarPopup
Dim oCtl3 As CommandBarPopup
Dim oCtlBtn As CommandBarButton

Set oCb = Application.CommandBars("Worksheet Menu Bar")
With oCb
Set oCtl1 = .Controls("Tools").Controls.Add( _
Type:=msoControlPopup, _
temporary:=True)
oCtl1.Caption = "Level1"
With oCtl1
Set oCtlBtn = .Controls.Add( _
Type:=msoControlButton)
oCtlBtn.Caption = "Level1 Button1"
oCtlBtn.FaceId = 161
oCtlBtn.OnAction = "myLevel1Button1Macro"
With oCtl1
Set oCtl2 = .Controls.Add( _
Type:=msoControlPopup)
oCtl2.Caption = "Level2"
With oCtl2
Set oCtlBtn = .Controls.Add( _
Type:=msoControlButton)
oCtlBtn.Caption = "Level2 Button1"
oCtlBtn.FaceId = 161
oCtlBtn.OnAction = "myLevel2Button1Macro"
Set oCtl3 = .Controls.Add( _
Type:=msoControlPopup)
oCtl3.Caption = "Level3"
With oCtl3
Set oCtlBtn = .Controls.Add( _
Type:=msoControlButton)
oCtlBtn.Caption = "Level3 Button1"
oCtlBtn.FaceId = 161
oCtlBtn.OnAction = "myLevel3Button1Macro"
End With
End With
End With
'etc.
End With
End With
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Bryan44" wrote in message
...
I'm wanting to add more than just one level of submenus to my special menu
created for my new Excel application. I know how to do this:

Menu Item 1
Menu Item 2
|
-- Submenu Item 1
-- Submenu Item 2
...
-- Submenu Item N
Menu Item 3

and so on. What I want to be able to do is:

Menu Item 1
Menu Item 2
|
-- Submenu Item 1
|
-- SubSubmenu Item 1
-- SubSubmenu Item 2
|
-- SubSubSubMenu Item 1
-- Submenu Item 2
...
-- Submenu Item N
Menu Item 3

Now that might not make sense to the most casual observer but I've added
many levels of print functionality on my dictator application and it does
make sense for printing out a range of charts/worksheets or selected ones.

Anyone know how to do this in VBA?

Sincerely,

Bryan



Reply
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
Adding Sub Menu Item to Current Custom Menu Renato Excel Programming 2 December 19th 05 12:48 AM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM
Adding a menu item right click menu when clicking on a single. Andoni[_28_] Excel Programming 0 September 2nd 04 10:23 PM
How to: reset the pull down menus to item 1 on start up? Brad Patterson Excel Programming 2 July 18th 03 08:34 AM
How to: reset the pull down menus to item 1 on start up? Brad Patterson Excel Programming 1 July 18th 03 07:25 AM


All times are GMT +1. The time now is 07:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"