J
Julie
I am working with Office 98 and Windows2000.
I have a custom toolbar (attached to a macro) that I would like to have
appear when I open the workbook and disappear when I close the workbook. I
am using the following code in the object 'This Workbook', but it is not
working. Can anyone tell me what I am doing wrong?
Public Sub CreateCommandBarButton()
Dim oCB As CommandBar
Dim objButton As CommandBarButton
With Application
Set oCB = .CommandBars.Add("Julie's toolbar", msoBarTop, , True)
With objButton
.Caption = "Delete Row"
.Tag = "Personal button"
.TooltipText = "Click here to delete the selected row"
.Style = msoButtonIconAndCaption
.OnAction = "DelRow"
End With
oCB.Visible = True
End With
End Sub
Public Sub DeleteCommandbar()
Application.CommandBars("Julie's toolbar").Delete
End Sub
Thank you for all of your help,
Julie
I have a custom toolbar (attached to a macro) that I would like to have
appear when I open the workbook and disappear when I close the workbook. I
am using the following code in the object 'This Workbook', but it is not
working. Can anyone tell me what I am doing wrong?
Public Sub CreateCommandBarButton()
Dim oCB As CommandBar
Dim objButton As CommandBarButton
With Application
Set oCB = .CommandBars.Add("Julie's toolbar", msoBarTop, , True)
With objButton
.Caption = "Delete Row"
.Tag = "Personal button"
.TooltipText = "Click here to delete the selected row"
.Style = msoButtonIconAndCaption
.OnAction = "DelRow"
End With
oCB.Visible = True
End With
End Sub
Public Sub DeleteCommandbar()
Application.CommandBars("Julie's toolbar").Delete
End Sub
Thank you for all of your help,
Julie