N
NetWave128
Public Sub HideTools()
Dim MyToolBars As CommandBarControls 'all toolbars
Dim MasterTools As CommandBarControls 'tools needed to use model a
user
On Error GoTo ErrorHandler
Set MasterTools = Application.CommandBars("Standard").Controls
For Each MyToolBar In CommandBarControl 'will loop for eac
commandbarcontrol open
'<> = is when comparing objects or If Not_OBJECT_Is_COLLECTION
If Not MyToolBar Is MasterTools Then
MyToolBar.Visible = False
End If
Next
Set MyToolBars = Nothing
Set MasterTools = Nothing
Exit Sub '<-- if everything runs error-free, you will exit here, BEFOR
the error handler.
ErrorHandler:
MsgBox "Sorry, an error occurred." & vbCrLf & "Number: " & Err.Number
vbCrLf & "Description: " & Err.Description, vbCritical, "Error"
End Su
Dim MyToolBars As CommandBarControls 'all toolbars
Dim MasterTools As CommandBarControls 'tools needed to use model a
user
On Error GoTo ErrorHandler
Set MasterTools = Application.CommandBars("Standard").Controls
For Each MyToolBar In CommandBarControl 'will loop for eac
commandbarcontrol open
'<> = is when comparing objects or If Not_OBJECT_Is_COLLECTION
If Not MyToolBar Is MasterTools Then
MyToolBar.Visible = False
End If
Next
Set MyToolBars = Nothing
Set MasterTools = Nothing
Exit Sub '<-- if everything runs error-free, you will exit here, BEFOR
the error handler.
ErrorHandler:
MsgBox "Sorry, an error occurred." & vbCrLf & "Number: " & Err.Number
vbCrLf & "Description: " & Err.Description, vbCritical, "Error"
End Su