|
-
Dec 13th, 1999, 01:24 AM
#1
Thread Starter
New Member
I have created a spreadsheet in Excel that when opened shows a message box asking for a password. How can I get it so that when the password is entered only stars/asteriks are shown.
Also how can I make it so that if the correct password is not entered after 3 attempts the application is closed down.
-
Dec 13th, 1999, 02:34 AM
#2
Fanatic Member
To make that stars kind of thing use PasswordChar Property of the TextBox (I assume that you use TextBox in your App). Set it to * (Star)
For you second question:
Try this:
Code:
Private Sub CmdCheckPassword_Click()
Static Counter As Integer
If TxtPass <> "MYPASSWORD" then
Counter=Counter + 1
Else
'Do whatever you want to do when user enters correct password
End If
If Counter = 3 Then End
End Sub
It should do the job.
I hope this helps
Regards QWERTY
------------------
Visual Basic Programmer
------------------
PolComSoft
You will hear a lot about it.
[This message has been edited by QWERTY (edited 12-13-1999).]
-
Dec 13th, 1999, 02:37 AM
#3
Just in case you are not aware of it, Excel already has a built-in password protection scheme that does some of what you want. Take a look at File>Save As>Options.
------------------
Marty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|