Custom Toolbar Not Appearing

  • Thread starter Thread starter Julie
  • Start date Start date
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 got it to work using the code from Bernie Deitrick who responded to a
message with the subject "Adding / Deleting from toolbars". I am curious why
this code didn't work, though. I used the following code before and it
worked wonderfully. Could it be that it works in OfficeXP and not Office98?

Julie
 
Back
Top