Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Juan,
the best way is to put it in the workbook open event, building it when it is opened. Here is an example, it goes in the ThisWorkbook code module Sub Workbook_Open() Dim oCB As CommandBar Dim oCBCtrl As CommandBarControl 'Delete CommandBar if it exists On Error Resume Next Application.CommandBars("myToolbar").Delete On Error GoTo 0 Set oCB = Application.CommandBars.Add(Name:="myToolbar", temporary:=True) With oCB Set oCBCtrl = .Controls.Add(temporary:=True) With oCBCtrl .Caption = "Function 1" .FaceId = 197 .OnAction = "myFunc1" End With Set oCBCtrl = oCB.Controls.Add(temporary:=True) With oCBCtrl .Caption = "Function 2" .FaceId = 198 .OnAction = "myFunc2" End With Set oCBCtrl = oCB.Controls.Add(temporary:=True) With oCBCtrl .Caption = "Function 3" .FaceId = 199 .OnAction = "myFunc3" End With .Visible = True .Position = msoBarTop End With End Sub Also, check out John Walkenbach's FaceId utility to see what icons are available to use at http://j-walk.com/ss/excel/tips/tip67.htm -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Juan" wrote in message ... Hi all... looking at the reply to the post macro sharing from Rob by Bob, I have another question regarding this... How do I add a Tool Bar to a AddIn File so that when the addin is loaded so is the toolbar. regards Juan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sharing or Emailing Macro | Excel Discussion (Misc queries) | |||
Problem removing sharing from workbook via Macro | Excel Discussion (Misc queries) | |||
Sharing macros and buttons that accompany the macro | Excel Discussion (Misc queries) | |||
sharing a macro | Excel Worksheet Functions | |||
Macro Sharing | Excel Programming |