I used to have that problem too. Got around it by making a custom menu file
(also thru code) and loading it as follows:
Public Const sCompany As String = "Jaypro Sports"
Dim sFile As String
sFile = Support_Path & sCo & ".mns"
lFile = FreeFile
Open sFile For Output As lFile
Print #lFile, sMenu
Close #lFile
'sMenu has the actual text of the menu
Set acGroup = ThisDrawing.Application.MenuGroups
Set acMenu = acGroup.Load(sFile)
Set acToolBar = acMenu.Toolbars.item(sCompany)
'apply icons to buttons
For i = 1 To UBound(sButtons, 2)
Set acButton = acToolBar.item(sButtons(2, i))
acButton.SetBitmaps sButtons(3, i), sButtons(3, i)
Next i
'apply icons to flyouts
For i = 1 To UBound(sFlyouts, 1)
'first the flyout main button
Set acToolBar = acMenu.Toolbars.item("zFly-" & sFlyouts(i, 2, 1))
For j = 1 To UBound(sFlyouts, 3)
'get out of loop at first empty string = last button
If sFlyouts(i, 1, j) = "" Then Exit For
'then the individual buttons
Set acButton = acToolBar.item(sFlyouts(i, 2, j))
acButton.SetBitmaps sFlyouts(i, 3, j), sFlyouts(i, 3, j)
Next
Next
acMenu.Save acMenuFileCompiled
HTH,
Kevin
"D Hartley"
wrote in message
news:4090eea1_3@newsprd01...
> I have a vba routine to create a macro-assigned toolbar . It creates the
> toolbar just fine, and the buttons work just fine.
> However, if I close AutoCAD, when I open AutoCAD again, the toolbar has
> disappeared.
>
> Can you see a probem with this bit of code?
>
> Dim objToolbar As AcadToolbar
> Set objToolbar=
ThisDrawing.Application.MenuGroups("ACAD").Toolbars.Add("My
> Toolbar")
>
> Thanks a lot
> David
>
>