View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default msoControlButton to "Worksheet Menu Bar" ?

Hi Soniya

Do you want this

Sub MenuBar_Item()
MenuBar_Item_Delete
With Application.CommandBars(1)
With .Controls.Add(Type:=msoControlButton, befo=1)
.Style = msoButtonCaption
.Caption = "&Hi"
.OnAction = ThisWorkbook.Name & "!TestMacro"
End With
End With
End Sub

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


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Soniya" wrote in message ups.com...
Hi All,

I find it easy to add an msoControlPopup menu item to "Worksheet Menu
Bar"

Is it possible to add msoControlButton to "Worksheet Menu Bar" ?

when I tried to get it does,nt work !?

Thanks