LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Blokeyfella
 
Posts: n/a
Default Password redundant through use of cancel

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
Rogue Password on Properties and References ExcelMonkey Excel Discussion (Misc queries) 0 October 5th 05 01:16 PM
Password Issue keithl816 Excel Discussion (Misc queries) 6 July 10th 05 06:20 PM
Import Data Keeps asking for Password Dominator Excel Discussion (Misc queries) 0 June 5th 05 11:25 PM
Password cannot be removed twa14 Excel Discussion (Misc queries) 3 December 14th 04 11:27 AM


All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"