Hello again,
I have some Worksheet event code:
The code fires also when the sheet gets activated in the:
Any ideas on how I can prevent the Worksheet_activate code from firing when triggered by the Workbook_BeforeClose event?
Thanks in advance,
Sige
I have some Worksheet event code:
Code:
Private Sub Worksheet_Activate()
Dim pwd As String: pwd = "splashpassword"
Cells(1, 1).Activate 'Cells(Rows.Count, Columns.Count).Activate
If LCase(Application.InputBox("What is the password to view this sheet?", "Access Password", "???")) <> pwd Then
ShowAlways.Activate 'WRONG PASSWORD GOTO another Sheet
MsgBox "Wrong password"
Else
Range("A1").Activate
End If
End Sub
The code fires also when the sheet gets activated in the:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'I hide all other sheets and activate the SplashSheet.
End Sub
Any ideas on how I can prevent the Worksheet_activate code from firing when triggered by the Workbook_BeforeClose event?
Thanks in advance,
Sige