J
JNW
Can a toolbar be docked?
I've created an add-in that creates a toolbar then it adds two buttons. All
this works perfect. I would like for the toolbar to automatically dock, or
once docked the first time by the user it will always remain there when Excel
is opened (like all the rest of the toolbars.
Any ideas? (see my code below)
Private Sub Workbook_Open()
Application.CommandBars("CN Tools").Delete
Set cmdCN = Application.CommandBars.Add("CN Tools", , , False)
With cmdCN
.Visible = True
'CreateRedUnderlineButton
With .Controls.Add(Type:=msoControlButton)
.TooltipText = "Underlines number in red"
.Picture = LoadPicture("H:\Tax return underline icon.bmp")
.OnAction = "NumberForTaxReturn"
End With
'Create button to number sheets
With .Controls.Add(Type:=msoControlButton)
.TooltipText = "Numbers all sheets in workbook"
.OnAction = "NumberAllSheetsInWorkbook"
.Picture = LoadPicture("H:\Number Sheets icon.bmp")
End With
End With
End Sub
I've created an add-in that creates a toolbar then it adds two buttons. All
this works perfect. I would like for the toolbar to automatically dock, or
once docked the first time by the user it will always remain there when Excel
is opened (like all the rest of the toolbars.
Any ideas? (see my code below)
Private Sub Workbook_Open()
Application.CommandBars("CN Tools").Delete
Set cmdCN = Application.CommandBars.Add("CN Tools", , , False)
With cmdCN
.Visible = True
'CreateRedUnderlineButton
With .Controls.Add(Type:=msoControlButton)
.TooltipText = "Underlines number in red"
.Picture = LoadPicture("H:\Tax return underline icon.bmp")
.OnAction = "NumberForTaxReturn"
End With
'Create button to number sheets
With .Controls.Add(Type:=msoControlButton)
.TooltipText = "Numbers all sheets in workbook"
.OnAction = "NumberAllSheetsInWorkbook"
.Picture = LoadPicture("H:\Number Sheets icon.bmp")
End With
End With
End Sub