To find out if the Command Bar exists, try:
For Each bar In Application.CommandBars
If bar.name = "My New Bar" Then
MsgBox "Menu Bar Exists: " & bar.Left _
& ", Width: " & bar.Width
If Not bar.Visible Then
bar.Visible = True
bar.Enabled = True
End If
Exit For
End If
Next
If the Tool Bar exists, but is not visible, it turns it on.
To make sure the most recent Command bar is available, I define it in
the Auto_Open sub of the file
'------------------------------------------------------
CMDbarName = "My New Bar"
Application.CommandBars(CMDbarName).Delete
'-------------------------------------------------------
' Create Command BAR
'-------------------------------------------------------
Set cComm = Application.CommandBars.Add
With cComm
.name = CMDbarName
.Position = msoBarTop
.RowIndex = msoBarRowFirst + 20
.Left = 600
.Visible = True
End With
'*******************************************************
'-------------------------------------------------------
' Open Tool Layouts
'-------------------------------------------------------
With cComm.Controls.Add(Type:=msoControlButton)
.Caption = "Open Document"
.Style = msoButtonIcon
.FaceId = 23
.OnAction = "Open_New_Document"
End With