Toolbars are saved with the users application so that you can
customise your set-up without it being altered every time you open a
spreadsheet from someone else who had a different toolbar setup. You
can, however, get your add-in to create a toolbar when it opens (if it
doesn't already exist). The following should help if this is what you
want to do.
Goodluck,
Andrew
Public Sub CreateDefaultToolbars()
On Error Resume Next 'since toolbar will likely already exist
CreateToolbar "CstmMenu1", Array(370, 369, 368, 1589, 1592, 385,
401, 1691)
CreateToolbar "CstmMenu1", Array(151, 146, 1699, 149, 150, 1704,
203)
End Sub
Private Sub CreateToolbar(strCBarName As String, avarCBarCtls As
Variant)
Dim cbr As CommandBar
Dim i As Integer
Set cbr = Application.CommandBars.Add(strCBarName, msoBarFloating,
, False)
For i = LBound(avarCBarCtls) To UBound(avarCBarCtls)
cbr.Controls.Add , avarCBarCtls(i)
Next
cbr.Visible = False
End Sub
'to get the IDs for the items that you want to add to your toolbar use
the
'following:
Private Sub GetCBarCtlIDs()
Dim cbr As CommandBar
Dim ctl As CommandBarControl
Set cbr = Application.CommandBars("NameOfMyToolbar")
For Each ctl In cbr.Controls
Debug.Print ctl.ID
Next
End Sub