View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default problems adding botton to a menu bar

Private Sub Workbook_AddinInstall()
With Application.CommandBars("Formatting").Controls.Add ( _
Type:=msoControlButton, ID:=2950, Befo=13)

.OnAction = "Test"
End With
End Sub


--
__________________________________
HTH

Bob

"filo666" wrote in message
...
Hello, I created an add in with a userform, I want to create a button that
opens the userform when clicked, in order to doing so I have until now in
my
add in workbook:

Private Sub Workbook_AddinInstall()
Application.CommandBars("Formatting").Controls.Add
Type:=msoControlButton,
ID:=2950, Befo=13
End Sub

but I do not know how to assign the macro to the button; the macro writen
in
the add in does not appear in the macro dialog box.

thanks