Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Toolbar at startup
I would like to add a toolbar whenever Excel is started. Right now I have a click-button to add data on the first sheet of a workbook, and would like for the control toolbox toolbar to be added to the users toolbar everytime this workbook is opened. Can this possibly be done via macro or some other way? Thanks in advance.
Brian |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Toolbar at startup
Brian,
Add this to the Workbook module: Private Sub Workbook_BeforeClose(Cancel As Boolean) On Error Resume Next Application.CommandBars("CB_Test").Delete End Sub Private Sub Workbook_Open() Dim cb As CommandBar Dim cbb As CommandBarButton On Error Resume Next Application.CommandBars("CB_Test").Delete Set cb = Application.CommandBars.Add(Name:="CB_Test", _ Position:=msoBarTop, temporary:=True) Set cbb = cb.Controls.Add(Type:=msoControlButton) With cbb .TooltipText = "Click me!" .FaceId = 10 .OnAction = ThisWorkbook.Name & "!RunMe" End With cb.Visible = True End Sub This will run the RunMe macro when the button is pressed. Cheers, Dave -----Original Message----- I would like to add a toolbar whenever Excel is started. Right now I have a click-button to add data on the first sheet of a workbook, and would like for the control toolbox toolbar to be added to the users toolbar everytime this workbook is opened. Can this possibly be done via macro or some other way? Thanks in advance. Brian . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Toolbar at startup
That did the trick, thanks.
Brian |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding a macro to a toolbar | Excel Discussion (Misc queries) | |||
Getting Duplicate items when adding to toolbar | Excel Discussion (Misc queries) | |||
Toolbar should not load at startup | Excel Discussion (Misc queries) | |||
How do I remove reviewing toolbar from startup | Setting up and Configuration of Excel | |||
Adding report manager to my toolbar | Excel Discussion (Misc queries) |