C
Chris W
This is the code im my class module called:
EventClassModule
Public WithEvents App As Application
Private Sub App_WorkbookDeactivate(ByVal Wb As Workbook)
Dim cnt As Integer, X As Integer
If ActiveWorkbook Is Nothing Then
cnt = Application.CommandBars("Worksheet Menu
Bar").Controls.Count
For X = 1 To cnt
If Application.CommandBars("Worksheet Menu
Bar").Controls(X).Caption = "&Rolodex Tools" Or _
Application.CommandBars("Worksheet Menu
Bar").Controls(X).Caption = "&Rolodex Tools*" Then
Application.CommandBars("Worksheet Menu
Bar").Controls(X).Enabled = False
Exit Sub
End If
Next X
End If
End Sub
--------------------------------------------------------
This is the subroutine placed in a standard module (this
is called from the ThisWorkbook > Workbook_Open() event of
Personal.XLS.
Dim EvntCl As New EventClassModule
Sub InitializeApp()
Set EvntCl.App = Application
End Sub
----------------------------------------------------------
EventClassModule
Public WithEvents App As Application
Private Sub App_WorkbookDeactivate(ByVal Wb As Workbook)
Dim cnt As Integer, X As Integer
If ActiveWorkbook Is Nothing Then
cnt = Application.CommandBars("Worksheet Menu
Bar").Controls.Count
For X = 1 To cnt
If Application.CommandBars("Worksheet Menu
Bar").Controls(X).Caption = "&Rolodex Tools" Or _
Application.CommandBars("Worksheet Menu
Bar").Controls(X).Caption = "&Rolodex Tools*" Then
Application.CommandBars("Worksheet Menu
Bar").Controls(X).Enabled = False
Exit Sub
End If
Next X
End If
End Sub
--------------------------------------------------------
This is the subroutine placed in a standard module (this
is called from the ThisWorkbook > Workbook_Open() event of
Personal.XLS.
Dim EvntCl As New EventClassModule
Sub InitializeApp()
Set EvntCl.App = Application
End Sub
----------------------------------------------------------