custom menu doesn't drop down via shortcut

M

mpa

My add-in puts a custom menu on the worksheet menu bar.

Works fine via the mouse.

Works fine when tapping ALT and then navigating with the arrow-keys.

It's called "Review" and the R shows the underline b/c I populated th
caption as "&Review".

Tapping ALT and then "R" does highlight/select the top of the men
correctly.

But it doesn't expand it, ie. it doesn't drop it down and reveal it
contents.

For all the built-in menus ALT plus the underlined letter does revea
the menu.

Is there something I need to be setting??
 
C

crispbd

It will show the contents of the dropdown *if the hotkey is unique*

Most likely there is another menu somewhere that uses the &R (or &r)

i.e. the d&raw menu in exce
 
R

Ron de Bruin

Hi mpa

It is working for me with this test example

Sub MenuBar_Item()
On Error Resume Next
Application.CommandBars(1).Controls("Review").Delete
On Error GoTo 0
With Application.CommandBars(1)
With .Controls.Add(Type:=msoControlButton, before:=1)
.Style = msoButtonCaption
.Caption = "&Review"
.OnAction = ThisWorkbook.Name & "!TestMacro"
End With
End With
End Sub

Sub MenuBar_Item_Delete()
On Error Resume Next
Application.CommandBars(1).Controls("Review").Delete
On Error GoTo 0
End Sub

Sub TestMacro()
MsgBox "Hi"
End Sub
 

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