Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi,
JE McGimpsey was kind enough to share a variant of the following code with me for password authentication; Const sPASSWORD As String = "****" Dim vResponse As Variant Do vResponse = Application.InputBox("Please enter the password") If vResponse = False Then Exit Sub 'User Cancelled If vResponse < sPASSWORD Then MsgBox "Unfortunately this is not the correct password" Loop Until vResponse = sPASSWORD This is great but does anybody know how to limit this to three "loops". I only want to give the individual inputting the password three attempts before the application quits. Thanks as always Andy -- Andy Tallent |
#2
![]() |
|||
|
|||
![]()
Try:
Const sPASSWORD As String = "****" Dim vResponse As Variant Dim i as Integer Do vResponse = Application.InputBox("Please enter the password") If vResponse = False Then Exit Sub 'User Cancelled If vResponse < sPASSWORD Then MsgBox "Unfortunately this is not the correct password" Else Exit Loop EndIf i = i+1 Loop Until i < 3 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I forgot my password for an excel workbook | Excel Discussion (Misc queries) | |||
bypass password when update linking of password protected file | Excel Discussion (Misc queries) | |||
Applying Existing Password to New Spreadsheet | Excel Discussion (Misc queries) | |||
How Delete Network Password Request-Worksheet in Website | Excel Worksheet Functions | |||
Password cannot be removed | Excel Discussion (Misc queries) |