+ Reply to Thread
Results 1 to 6 of 6

Password protect workbook two passwords

  1. #1
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Password protect workbook two passwords

    Hello,

    I want to password protect an excel workbook (password required to open and view), but i want a different password to be applicable on Saturday and Sunday.

    Basically, i want to limit certain peoples access to the workbook to specific days of the week. Is such a thing possible?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    05-12-2018
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    266

    Re: Password protect workbook two passwords

    With al little help of VBA with an inputbox..

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Password protect workbook two passwords

    see attached workbook.
    When you open it, it'll show just a Welcome worksheet.
    It'll ask for password [weekday or weekend], depending on day of week.
    I've hard coded 1234 for weekend and 0000 for weekday.
    It'll unhide worksheets based on correct password.
    You can further protect worksheets from viewing by setting the Visible to 2 so users can't unhide them easily.

    Hopefully, this will give you some idea on how to setup your workbook.

    Macros used:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,908

    Re: Password protect workbook two passwords

    This solution is a bit more automatic.

    Please Login or Register  to view this content.
    This is "air code" - I have not tested it at all.

    Take the attached file an put it on a hard drive somewhere on the network. On the same machine that hosts this file, set up two windows task scheduler events: one to run at midnight, Saturday morning and the other to run at midnight Monday morning (or whatever times are appropriate). The code will figure out which passwords to set based on the day of the week. You may have to set the password on the target file manually for the first run.

    This workbook has an on open event that runs the macro to change the password. It keeps a log of what it has done. If you want to read the log without firing the macro, open Excel and navigate to the file and hold down the SHIFT key while clicking on OPEN.

    The following is one way to set up the task scheduler: http://www.utteraccess.com/wiki/Schedule_a_Macro_to_Run. Also do a web search on how to use the task scheduler for the OS you are using.

    You can also run this program manually.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  5. #5
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: Password protect workbook two passwords

    Thank you both!

  6. #6
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Password protect workbook two passwords

    Hope this solved your problem.

+ 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. Replies: 2
    Last Post: 11-17-2014, 04:28 PM
  2. Replies: 3
    Last Post: 07-01-2014, 02:48 PM
  3. Replies: 1
    Last Post: 04-12-2012, 03:42 AM
  4. Password Protect - Multiple Passwords
    By aspears in forum Excel General
    Replies: 0
    Last Post: 12-08-2008, 01:12 PM
  5. WorkBook Password Protect
    By rz6657 in forum Excel General
    Replies: 0
    Last Post: 09-27-2006, 09:44 PM
  6. [SOLVED] Passwords Disappear in OpenOffice (Protect Worksheet, and Protect Workbook)
    By msnews.microsoft.com in forum Excel General
    Replies: 6
    Last Post: 12-27-2005, 04:20 AM
  7. Replies: 2
    Last Post: 07-16-2005, 11:05 AM

Tags for this Thread

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