Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have written an application that uses passwords to prevent unauthorised
users from changing data. This functions in the normal way i.e. by displaying an input box for the password with OK and Cancel buttons. When no password or an incorrect password is entered, an error message is displayed on screen (msgbox "Incorrect. Please check caps lock is off and try again"). However when Cancel is selected, rather than show this error message, the macro ticks through as though the correct password has been entered. This is doubly frustrating as another application I have written does all of the above but when cancel is pressed, pulls up the error message (as required). I have included the necessary code below, the version is MS Excel 2000. PLEASE help me to understand why one of my applications is operating differently (and wrongly) to the other. Thanks. The code: Windows("Training Log.xls").Activate Application.ScreenUpdating = False Sheets("Menu").Select On Error GoTo TPassword_Err ActiveSheet.Unprotect Range("A1").Select Sheets("AddTraining").Visible = True Sheets("Menu").Visible = False Sheets("AddTraining").Select Application.ScreenUpdating = True Range("C26").Select Exit Sub TPassword_Err: MsgBox "Password Incorrect." & vbCrLf & vbCrLf _ & "Please check caps lock is off. Click on the Continue button to try again" Application.ScreenUpdating = True end sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect Workbook vs Worksheet?? | Excel Worksheet Functions | |||
Rogue Password on Properties and References | Excel Discussion (Misc queries) | |||
Password Issue | Excel Discussion (Misc queries) | |||
Import Data Keeps asking for Password | Excel Discussion (Misc queries) | |||
Password cannot be removed | Excel Discussion (Misc queries) |