+ Reply to Thread
Results 1 to 9 of 9

Multiple Usernames and Passwords

  1. #1
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Multiple Usernames and Passwords

    Good day all once again,

    I have a workbook attached (made up from numerous codes found while spending hours on this amazing site) that uses multiple passwords & usernames, I have a worksheet table that holds all the usernames & password & also grants them either limited access or full access. Just when I thought I had it...I tweaked part of the access code & now have two further issues I can't undo:

    1st is when you enter the correct code it allows access as specified but still tries to close the workbook?

    2nd is when you enter a complete wrong password or no text at all the workbook closes without showing my message box "Incorrect Information - Access Denied - Workbook will now close"

    If the text entered is almost correct I do have a msgbox that say "Almost but not quite" & closes the workbook but if possible i would love to have three attempts if the text entered is almost right, this is not important but would make the workbook Perfect! Thank you again guys for any assistance with this & have a fantastic day - Marco
    Attached Files Attached Files

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

    Re: Multiple Usernames and Passwords

    Maybe:
    Please Login or Register  to view this content.
    _________________
    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!)

  3. #3
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Multiple Usernames and Passwords

    Now my solution is in no way a solution to what you asked for, but it is an alternative solution to multiple users that does not even require them to enter a password, but is based on their usernames. So Excel will know who accesses the spreadsheet with the code below. This requires your sheet to have a sheet called Users with three colomns

    User Shortname User Fullname accesslevel

    The user Shortname is the Environ("username") which you can find out by running a simple msgbox Environ("username") code.
    The User Fullname is the name of your colleague/employee/friend that will be displayed when they open the file
    The access level you set yourself but has to be either:

    Full access (ie edit, delete rows etc)
    Full access but no deletion capability
    Autofilter access, edit access, no delete ability

    See the code below and you can change or add more options.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-23-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Multiple Usernames and Passwords

    May i know whats the user name and password. Because i can't able to login into excel sheet.

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

    Re: Multiple Usernames and Passwords

    The username and password are in plain sight on the sheet on the left....

  6. #6
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Re: Multiple Usernames and Passwords

    Thanks JBeaucaire, great simple advice as always, works on point 1 perfectly!

    Hi nickmax1, I like the sound of this code & the way it picks out the "username" of who ever is logged on, i'll do some work on it when I get a chance...in the mean time, do you have a working example of this? Either way thanks for your help guys & have a great week! - Marco
    Last edited by matrixpom; 01-29-2013 at 05:23 PM.

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

    Re: Multiple Usernames and Passwords

    Some code snippets you can use might be:

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Re: Multiple Usernames and Passwords

    Thanks JBeaucaire, ("Username") works perfect, I've actually updated my workbook with this code & now its finished it looks & works fantastic, definitely a piece of code worth keeping, thanks again to both of you! - Marco

  9. #9
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Multiple Usernames and Passwords

    here is my code in an example sheet.

    password to unlock the sheetand change the username and User Name full is "PASSWORD"

    let me know what you think
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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