Private Function FindCommandBarByName(cName As String) As CommandBar
Dim nIndex As Long
Set FindCommandBarByName = Nothing
For nIndex = 1 To Application.CommandBars.Count
If (Application.CommandBars.Item(nIndex).Name = cName) Then
Set FindCommandBarByName = Application.CommandBars.Item(nIndex)
Exit Function
End If
Next nIndex
End Function
Private Sub show_bar(Name As String)
Dim oToolbar As CommandBar
Set oToolbar = FindCommandBarByName(Name)
If Not oToolbar Is Nothing Then
oToolbar.Visible = True
oToolbar.Enabled = True
End If
End Sub
Sub ShowMacrosToolbar()
show_bar "Macros"
End Sub