Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problems adding botton to a menu bar
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
problems adding botton to a menu bar
Thnaks, It worked perfectly;
other question, How to add a different image to the macro button?? How to change the button description? "Bob Phillips" wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
problems adding botton to a menu bar
If you want one of Excel's images, you just need to set the FaceId property.
If you want a custom image, you need to save it in your workbook, copy and paste it in. -- __________________________________ HTH Bob "filo666" wrote in message ... Thnaks, It worked perfectly; other question, How to add a different image to the macro button?? How to change the button description? "Bob Phillips" wrote: 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
problems adding botton to a menu bar
Great, thanks for your help, everything worked perfectly now!!!
"Bob Phillips" wrote: If you want one of Excel's images, you just need to set the FaceId property. If you want a custom image, you need to save it in your workbook, copy and paste it in. -- __________________________________ HTH Bob "filo666" wrote in message ... Thnaks, It worked perfectly; other question, How to add a different image to the macro button?? How to change the button description? "Bob Phillips" wrote: 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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
problems adding botton to a menu bar
..Caption = "Description"
..FaceID = the ID number of an image Mike F "filo666" wrote in message ... Thnaks, It worked perfectly; other question, How to add a different image to the macro button?? How to change the button description? "Bob Phillips" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding a Custom menu / sub menu | Excel Programming | |||
Menu Bar Problems | Excel Programming | |||
Adding Sub Menu Item to Current Custom Menu | Excel Programming | |||
Adding a menu item right click menu when clicking on a single. | Excel Programming | |||
Adding menu to the mouse right click pop-up menu | Excel Programming |