K
Kurt Barr
I have a menu bar that I'm creating as soon as a worksheet is opened. But,
once it's open, the graphic for the button doesn't show up until I actually
place my mouse over it. Is this a problem with the coding I'm using, or is it
something else that is causing it.
Here is the code that I'm using to create the menu bar:
Sub PriceToolBar()
Dim cbrCommandBar As CommandBar
Dim cbcCommandBarButton As CommandBarButton
On Error Resume Next
Application.CommandBars("Pricing").Delete
Set cbrCommandBar = _
Application.CommandBars.Add
With cbrCommandBar
.Visible = True
.Position = msoBarTop
.Name = "Pricing"
.Left = 100
End With
With cbrCommandBar.Controls
Set cbcCommandBarButton = _
.Add(msoControlButton)
With cbcCommandBarButton
.Style = msoButtonIconAndCaptionBelow
.FaceId = 275
.TooltipText = _
"Prospect Pricing"
.OnAction = "Prospect"
.Tag = "Prospect"
End With
End With
cbrCommandBar.Visible = True
NewToolBar
End Sub
once it's open, the graphic for the button doesn't show up until I actually
place my mouse over it. Is this a problem with the coding I'm using, or is it
something else that is causing it.
Here is the code that I'm using to create the menu bar:
Sub PriceToolBar()
Dim cbrCommandBar As CommandBar
Dim cbcCommandBarButton As CommandBarButton
On Error Resume Next
Application.CommandBars("Pricing").Delete
Set cbrCommandBar = _
Application.CommandBars.Add
With cbrCommandBar
.Visible = True
.Position = msoBarTop
.Name = "Pricing"
.Left = 100
End With
With cbrCommandBar.Controls
Set cbcCommandBarButton = _
.Add(msoControlButton)
With cbcCommandBarButton
.Style = msoButtonIconAndCaptionBelow
.FaceId = 275
.TooltipText = _
"Prospect Pricing"
.OnAction = "Prospect"
.Tag = "Prospect"
End With
End With
cbrCommandBar.Visible = True
NewToolBar
End Sub