Hi,
I have written simple date check on open in one of my files, that prompts for password when it is expired and want to add wrong password counter and will add some more code to it on lets say 3 wrong attempts, but can not manage it to work.
Any help is greatly appreciated, thanks.
I have written simple date check on open in one of my files, that prompts for password when it is expired and want to add wrong password counter and will add some more code to it on lets say 3 wrong attempts, but can not manage it to work.
Code:
Private Sub Workbook_Open()
Dim pass As Variant
Dim exdate As Date
exdate = "01/06/2019"
If Date > exdate Then
pass = Application.InputBox("Please enter password")
Select Case pass
Case Is = "yes"
Case Else
MsgBox "Oopsie"
Application.DisplayAlerts = False
ActiveWorkbook.Close
End Select
End If
End Sub
Any help is greatly appreciated, thanks.