View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
DM Unseen DM Unseen is offline
external usenet poster
 
Posts: 233
Default Hide And Un-hide Excel Toolbars

Sub showhide(bHide As Boolean)
Dim cmb As CommandBar
Static col As New Collection

If bHide Then
For Each cmb In Application.CommandBars
If cmb.Type = msoBarTypeMenuBar Or cmb.Type = msoBarTypeNormal Then
If cmb.Visible Then
cmb.Visible = False
cmb.Enabled = False
col.Add cmb, cmb.Name
End If
End If
Next cmb
Else
For Each cmb In col
cmb.Visible = True
cmb.Enabled = True
Next cmb
Set col = Nothing
End If


End Sub

DM Unseen