Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default submenu help (how to create arrow for expanding menu)

How is a menu created from an item in a menu? For example, in Excel the
"Data" "Filter" menu expands to auto filter etc. How can I create this in a
custom menu. The menu displays a small arrow on the right that then expands
to another menu.

Thanks!
Dave

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default submenu help (how to create arrow for expanding menu)

Dave,

When creating the menu item, you define it as type msoControlPopup, not
msoControlButton. You then have to create controls within that control to
have the next level, something like

Sub PartsMenu()
Dim HelpMenu As CommandBarControl
Dim MainMenu As CommandBarPopup
Dim MenuItem As CommandBarControl
Dim Submenuitem As CommandBarButton


' Deletes menu if it exits
Call DeleteMenu


' Find the help menu
Set HelpMenu = CommandBars(1).FindControl(ID:=30010)


If HelpMenu Is Nothing Then
' Add the menu to the end
Set MainMenu = CommandBars(1).Controls. _
Add(Type:=msoControlPopup, temporary:=True)
Else
' Add menu before help
Set MainMenu = CommandBars(1).Controls. _
Add(Type:=msoControlPopup, befo=HelpMenu.Index, _
temporary:=True)
End If


' Add caption
MainMenu.Caption = "&Parts Utility"


' Searching for parts
Set MenuItem = MainMenu.Controls.Add _
(Type:=msoControlButton)
With MenuItem
.Caption = "&Search Parts..."
.FaceId = 48
.ShortcutText = "Ctrl+Shift+S"
.OnAction = "SetupSearch"
End With


' LO / Remaining printout
Set MenuItem = MainMenu.Controls.Add _
(Type:=msoControlButton)
With MenuItem
.Caption = "&Generate Parts Review..."
.FaceId = 285
.ShortcutText = "Ctrl+Shift+D"
.OnAction = "LORemaining"
End With


' View summary sheet
Set MenuItem = MainMenu.Controls.Add _
(Type:=msoControlPopup)
With MenuItem
.Caption = "Sub menu"
End With


Set Submenuitem = MenuItem.Controls.Add _
(Type:=msoControlButton)
With Submenuitem
.Caption = "&View Summary..."
.FaceId = 592
.OnAction = "Summary"
End With


' Error is here :(
' Print summary sheet
Set Submenuitem = MenuItem.Controls.Add _
(Type:=msoControlButton)
With Submenuitem
.Caption = "Print Summary"
' .Application = 364
.OnAction = "PrintSummary"
End With
End Sub


Sub DeleteMenu()
On Error Resume Next

Application.CommandBars("Worksheet Menu Bar").Controls("Parts
Utility").Delete


End Sub



--

HTH

RP
(remove nothere from the email address if mailing direct)


"dave k" wrote in message
...
How is a menu created from an item in a menu? For example, in Excel the
"Data" "Filter" menu expands to auto filter etc. How can I create this in

a
custom menu. The menu displays a small arrow on the right that then

expands
to another menu.

Thanks!
Dave



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
how do I show the arrow for dropdown menu in excel? dorinc29 Excel Worksheet Functions 1 May 6th 08 12:16 AM
Is there a way to always view the drop-down menu arrow, without h. vmriz Excel Discussion (Misc queries) 0 August 17th 07 01:47 AM
Create Dropdown menu without using the Validation on the Data Menu lostinformulas Excel Worksheet Functions 0 July 13th 06 08:47 PM
When I drag the mouse arrow over menu buttons, no description app. Bill Tasker Excel Discussion (Misc queries) 1 December 14th 04 10:20 AM
Add submenu to custom menu Excel[_3_] Excel Programming 1 July 23rd 03 08:07 AM


All times are GMT +1. The time now is 01:44 AM.

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

About Us

"It's about Microsoft Excel"