Toolbar

  • Thread starter Thread starter Bruce Roberson
  • Start date Start date
B

Bruce Roberson

I am developing a list of toolbar items that I want to
share with other users.

Can I export a toolbar to a file and then import it on
another person's computer?

Thanks,


Bruce
 
Bruce,

You can have a workbook that create a toolbar dynamically. This example adds
an item to the formatting toolbar.

Dim oCtl As CommandBarControl
With Application.CommandBars("Formatting")
Set oCtl = .Controls.Add(Type:=msoControlButton, temporary:=True)
With oCtl
.BeginGroup = True
.Caption = "myButton1"
.OnAction = "myMacro"
.FaceId = 27
End With
End With

You can add to any toolbar, or even create your own. like so

Dim oCB As CommandBar
Dim oCtl As CommandBarControl
Set oCB = Application.CommandBars.Add(Name:="myCB", temporary:=True)
With oCB
Set oCtl = .Controls.Add(Type:=msoControlButton, temporary:=True)
With oCtl
.BeginGroup = True
.Caption = "myButton1"
.OnAction = "myMacro"
.FaceId = 27
End With
.Visible = True
.Position = msoBarTop
End With

Or you can be a lot more extravagant.


As I alway say with this, I also suggest you check out John Walkenbach's
site at http://j-walk.com/ss/excel/tips/tip67.htm to help find the values of
the FaceIds, which will give you a decent toolbar button image.
 
Bob:

I've already got the toobar. I just wanted to know if the
custom toolbar I have now can be exported from my machine
to a file that I could then import to another machine so
someone else could benefit from my goody list on the
toolbar I come up with. I wasn't looking for a macro to
run at this point.
 
Back
Top