View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Juan[_3_] Juan[_3_] is offline
external usenet poster
 
Posts: 13
Default New menu bar item

Hi all

I'm trying to get a new item in the Worksheet Menu Bar
with an Add Inn, originally it was going to be one item
and it worked fine...i got it to appear on the Tools Menu
and to react as I wanted... soon my fellow workmates came
up with a similar need so what I tried is to have an item
on the tools menu that is like a combo menu (i.e.
the "Protection" menu inside the "tools" menu, has 3
items) but i have not been able to get a combo item inside
the tools menu... this is my code for the normal extra
control in the tools menu:

Sub createmenu()

Dim NewItem As CommandBarButton
Dim XLMenu As String
Dim XLCB As String
Dim NewItemName As String

XLCB = "Worksheet Menu Bar"
XLMenu = "Tools"

NewItemName = "Tool name here!"

On Error Resume Next
Application.CommandBars(XLCB).Controls(XLMenu).Con trols
(NewItemName).Delete

Set NewItem = Application.CommandBars(XLCB).Controls
(XLMenu).Controls.Add
With NewItem
..Caption = NewItemName
..OnAction = "macro name here!"
..FaceId = 0
..BeginGroup = True
End With

End Sub

I would like this to be a dropdown combo from where now i
choose from several tools....

any help is greatly appreciated...

regards
JS