Home
Manage Your Code
Snippet: ShowOneToolBar (VBA)
Title: ShowOneToolBar Language: VBA
Description: Disable all toolbars except the one stipulated in ExceptionName argument plus all popups... Views: 500
Author: Steve Moore Date Added: 3/19/2010
Copy Code  
1Function ShowOneToolBar(ExceptionName As String)
2Dim i As Integer
3For i = 1 To CommandBars.Count
4        If CommandBars(i).Name <> ExceptionName Then
5            If CommandBars(i).Type <> msoBarTypePopup Then CommandBars(i).Enabled = False
6        Else
7            CommandBars(i).Enabled = True
8        End If
9Next i
10End Function