Discussion Locked

Custom Toolbars in Excel Template

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I save a custom toolbar into my excel template, but when i open excel to a blank document, it also is saved in there also.
How do i get it to save into my template.
Any ideas.

3 replies

by dklippert

Create the Toolbars on the fly. Here's some sample code from the forums:

Sub Auto_Open()
CreateToolbar
End Sub

Sub Auto_Close()
RemoveToolbar
End Sub

Sub CreateToolbar()
Set CabDocBar = CommandBars _
.Add(Name:="CabDoc", Position:=msoBarFloating, _
Temporary:=True)
With CabDocBar
.Controls.Add Type:=msoControlButton, ID:=2
.Visible = True
End With
End Sub

Sub RemoveToolbar()
For Each bar In Application.CommandBars If Not bar.BuiltIn Then bar.Delete
Next
End Sub

by mckay_w

just had to go to customise, and attach the toolbar to that workbook

all done

This discussion is closed to new replies.