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
 
compare it to the working code and see what is different. Start looking
there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top