Results 1 to 3 of 3

Thread: Passwords

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Camberley, England
    Posts
    3

    Post

    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.

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    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).]

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    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
  •  



Click Here to Expand Forum to Full Width