I have one custom menubar and one custom toolbar that should both be visible at the same time with the same form. The problem is that when the form opens, the toolbar and the menu bar keep changing their positions, seemingly at random. Sometimes the menubar is on top of the toolbar, and sometimes the toolbar is on top of the menubar.
I would like the menu bar to be at the very top and the toolbar to be right below the menu bar every single time.
I tried using the following code to accomplish this but it does not work:
Dim myBar As CommandBar
Dim myBar2 As CommandBar
Set myBar = CommandBars("xMenuBar")
myBar.Position = msoBarTop
With myBar
.Left = 0
.Top = 0
End With
Set myBar2 = CommandBars("xToolbar")
myBar.Position = msoBarTop
With myBar2
.Left = 0
.Top = 45
End With
Does anybody know how to make these two commandbars remain in their relative positions every time the form opens???
I would like the menu bar to be at the very top and the toolbar to be right below the menu bar every single time.
I tried using the following code to accomplish this but it does not work:
Dim myBar As CommandBar
Dim myBar2 As CommandBar
Set myBar = CommandBars("xMenuBar")
myBar.Position = msoBarTop
With myBar
.Left = 0
.Top = 0
End With
Set myBar2 = CommandBars("xToolbar")
myBar.Position = msoBarTop
With myBar2
.Left = 0
.Top = 45
End With
Does anybody know how to make these two commandbars remain in their relative positions every time the form opens???