How do I ensure a custom command bar ends up under the Window Men Bar when opening, deactivating and activating the workbook.
I think I am running all the code correctly but I can't seem to get the right combination of index, rowindex, position, top or something correct.
I also have code that hides and unhides existing visible command bars.
Sometimes the custom bar is on top of the WMB, or it is the forth bar down (standard and formatting ends up between custom and WMB).
IN THE CREATE BAR SUB I'M USING THIS:<pre>Set UDMcb = CommandBars.Add
With UDMcb
.Name = "UDM"
.Enabled = True
.Visible = True
.Position = msoBarTop
'.RowIndex = msoBarRowLast
.Top = 1
.Left = 0
.Visible = True
.Protection = msoBarNoCustomize + msoBarNoMove
End With</pre>
IN THE WORKBOOK ACTIVATE SUB I'M TRYING SOMETHING LIKE THIS:<pre>Private Sub Workbook_Activate()
On Error Resume Next
' make the commandbar visible when the workbook is activated
Application.CommandBars("UDM").Visible = True
Application.CommandBars("UDM").Position = 1
On Error GoTo 0
End Sub</pre>
This message was edited by EM on 2002-10-15 01:51
This message was edited by em on 2002-10-18 01:24
This message was edited by em on 2002-10-18 01:26
This message was edited by em on 2003-01-31 23:51
I think I am running all the code correctly but I can't seem to get the right combination of index, rowindex, position, top or something correct.
I also have code that hides and unhides existing visible command bars.
Sometimes the custom bar is on top of the WMB, or it is the forth bar down (standard and formatting ends up between custom and WMB).
IN THE CREATE BAR SUB I'M USING THIS:<pre>Set UDMcb = CommandBars.Add
With UDMcb
.Name = "UDM"
.Enabled = True
.Visible = True
.Position = msoBarTop
'.RowIndex = msoBarRowLast
.Top = 1
.Left = 0
.Visible = True
.Protection = msoBarNoCustomize + msoBarNoMove
End With</pre>
IN THE WORKBOOK ACTIVATE SUB I'M TRYING SOMETHING LIKE THIS:<pre>Private Sub Workbook_Activate()
On Error Resume Next
' make the commandbar visible when the workbook is activated
Application.CommandBars("UDM").Visible = True
Application.CommandBars("UDM").Position = 1
On Error GoTo 0
End Sub</pre>
This message was edited by EM on 2002-10-15 01:51
This message was edited by em on 2002-10-18 01:24
This message was edited by em on 2002-10-18 01:26
This message was edited by em on 2003-01-31 23:51