+ Reply to Thread
Results 1 to 12 of 12

Password Protection Formula - Remembering I already entered the Password!

  1. #1
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Password Protection Formula - Remembering I already entered the Password!

    Hello,

    The Add Data Button has a Password protection which works really great - but the issue was brought up that when the User enters the Password the first time there is NO issues with this... but if the User closes the Userform and does not close the workbook, and wants to add more data to the Userform again, the User has to re-enter the password...

    The question was raised that can't there be a code or formula that can be written to see that the User is still in the workbook and a password is not required because it was already entered correctly the first time?



    Best Regards
    Last edited by JJFletcher; 11-07-2014 at 08:51 PM. Reason: spelling

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Password Protection Formula - Remembering I already entered the Password!

    I am not able to answer this, but would raise a question instead.

    Wouldnt it be better to force the use to re-enter the PW each time, in case user2 uses the file while user1 is away for a few minutes?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Password Protection Formula - Remembering I already entered the Password!

    That is a great question and is currently setup that way - yet the User is required to control, alt, delete the computer and lock it when away from the system - so the User should be the only using the workbook at that time - when complete - they close the Excel.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Password Protection Formula - Remembering I already entered the Password!

    We have the same ctrl alt del here, but many users still dont follow that practice. Anyway, it was just a thought

  5. #5
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Password Protection Formula - Remembering I already entered the Password!

    Well, Do any of the other moderators have an opinion on this question? Does anyone else have any thoughts?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Password Protection Formula - Remembering I already entered the Password!

    My recommendation:

    1) select a hidden location in your workbook somewhere and write down the "Password OK" flag when someone successfully logs in. This will survive the form being closed

    2) Add a check of that cell to your userform initialization sequence. If that cell say "Password OK", it skips the password check, else it forces it.

    3) Add a Workbook_BeforeClose event that will clear this cell and save the doc
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Password Protection Formula - Remembering I already entered the Password!

    JBeaucaire,

    This sounds complicated... As you can see I have several threads open trying to attain a solution to this access issue - I don't want Admin Users to get frustrated having to keep entering the password and coming up with a solution for main access like a splash screen maybe and non admin users only have read only privileges etc... no samples to review that I can find

    John

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Password Protection Formula - Remembering I already entered the Password!

    Hi JJFletcher,

    What JBeaucaire suggested makes perfect sense, as it is exactly what I do with multiple access levels. I sounds complicated, but it is not really.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Password Protection Formula - Remembering I already entered the Password!

    The lines of code are pretty simple, you will have to work out in your form initialization where they go and if they need "tweaking".

    When password is successfully entered, this would write down a note on a given sheet to that fact:
    Please Login or Register  to view this content.


    In your form code where you're about to start the process for asking for the password, you would check that cell above first:
    Please Login or Register  to view this content.

  10. #10
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Password Protection Formula - Remembering I already entered the Password!

    Would it be possible to never unload the user form until the Workbook_BeforeClose event.
    Just Hide it instead? Thus the PaswordOK status wouldn't be lost when the user form was unloaded.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  11. #11
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Password Protection Formula - Remembering I already entered the Password!

    Mikerickson,

    How would that be achieved?

    John

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Password Protection Formula - Remembering I already entered the Password!

    Use a Userform.Hide instead of Userform.Unload.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Password Protection not accepting password
    By Rob K in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 06-20-2014, 07:00 AM
  2. Stop Running Script if Sheet Protection Password Entered Incorrectly
    By gjohn282 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2014, 08:53 PM
  3. password protection-is there anyway to put a password on running a macro in excel?
    By Solarissf in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2008, 10:06 AM
  4. Password protection...
    By dustyv in forum Excel General
    Replies: 3
    Last Post: 11-23-2006, 08:05 AM
  5. [SOLVED] Password Protection
    By ralph in forum Excel General
    Replies: 2
    Last Post: 04-17-2006, 05:00 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1