Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Adding Toolbar at startup

That did the trick, thanks.

Brian
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a macro to a toolbar Dudley Excel Discussion (Misc queries) 7 March 17th 09 03:42 PM
Getting Duplicate items when adding to toolbar djmillis Excel Discussion (Misc queries) 0 May 9th 08 02:43 PM
Toolbar should not load at startup sharkfoot Excel Discussion (Misc queries) 5 March 23rd 06 11:47 PM
How do I remove reviewing toolbar from startup Cordovan Setting up and Configuration of Excel 1 May 24th 05 07:05 PM
Adding report manager to my toolbar rpc1040 Excel Discussion (Misc queries) 0 March 14th 05 10:45 PM


All times are GMT +1. The time now is 01:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"