Position of MyBar

G

GregR

I have a custom toolbar that opens with a specific WB. I want to
position it at the end of the "Formatting toolbar" on the 3rd Row, not
in its own seperate row. How do I accomplish this? TIA

Greg
 
D

Dave Peterson

Maybe something like:

Option Explicit
Sub testme()

Dim cb As CommandBar
Dim fCB As CommandBar

Set fCB = Application.CommandBars("Formatting")

On Error Resume Next
Application.CommandBars("Mybar").Delete
On Error GoTo 0

Set cb = Application.CommandBars.Add(Name:="mybar", temporary:=True)

With cb
.Visible = True
.Position = msoBarTop
.Visible = True
.Left = fCB.Width + fCB.Left
.RowIndex = fCB.RowIndex
End With

End Sub
 

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

Top