Custom Toolbar position

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

I have the follwoing code that creates a toolbar when the
workbook is open. What I want to do is to make it show up
at the top of the screen not right in the middle where it
does now. Help

Application.CommandBars.Add(Name:="COUNT").Visible =
True
Application.CommandBars("COUNT").Controls.Add
Type:=msoControlButton, ID:=3 _
, Before:=1
Application.CommandBars("COUNT").Controls.Add
Type:=msoControlButton, ID:= _
752, Before:=2
 
Application.CommandBars.Add(Name:="COUNT").Top = 0
would put it at the top of the screen
 
That puts it at the top, but I would like it to be
positioned at the topleft where the starndard toolbar
would have been had I not hidden it.
You would see the name of the file then the toolbar set in
postiton like a normal tool bar. If I have you lost I am
sorry
 
thought it was a floating toolbar:

Sub BBBB()
On Error Resume Next
Application.CommandBars("COUNT").Delete
On Error GoTo 0
Application.CommandBars.Add(Name:="COUNT", _
Position:=msoBarTop, MenuBar:=True).Visible = True
Application.CommandBars("COUNT").Controls.Add _
Type:=msoControlButton, ID:=3, Before:=1
Application.CommandBars("COUNT").Controls.Add _
Type:=msoControlButton, ID:=752, Before:=2
End Sub

delete COUNT to get the worksheet menu bar back.
 
Back
Top