Results 1 to 3 of 3
  1. #1

    Is this possible ? !!!!!!!

    if is not..just ignored it..on my workbook i want to load
    a userform that introduce a little bit my school..

    sub auto_open()
    end sub

    after i close the 'school' userform..i want another
    user to appeared..on that will be a box
    that required users to put the valid passwword to open
    the is possible..many thanks..i know excel
    have their own built in password protection but i don't
    want to use it..i want attached the password to a userform..

    ps : if possible..i want there is only 3 times chances
    for users to key in the passwords..after 3 times..the workbook will close automatically..thanks

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Dublin, Ireland, Republic of
    Thanked 0 Times in 0 Posts

    Re: Is this possible ? !!!!!!!

    Azri, attached find a file with a password box on open
    The following code handles the password entry and validation <pre>Sub Auto_Open()
    Dim Password As String
    Dim NoAccess As Boolean
    Dim Count As Integer
    Password = "AZRI"
    NoAccess = True
    Count = 0
    Do While NoAccess And Count < 3
    Count = Count + 1
    If PassForm.PassText = Password Then
    NoAccess = False
    End If
    If NoAccess Then ThisWorkbook.Close
    Unload PassForm
    End Sub</pre>

    You will note that the password is AZRI. It is not very secure at present as anybody could just interupt the macro and view the code. You could hide the password in a hidden sheet (xlVeryhidden), and retrieve it in the proceedure for validation.

    Attached Files Attached Files

  3. #3

    Re: Is this possible ? !!!!!!!

    thanks again and again works like a charm..
    cheers and regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts