+ Reply to Thread
Results 1 to 5 of 5

Protecting multiple workbooks in a directory - Automation

  1. #1
    Registered User
    Join Date
    10-26-2015
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Protecting multiple workbooks in a directory - Automation

    Hi everyone,

    I have joined this forum to request your expert knowledge for a problem I have searched for a while now but found no solution.

    Problem:
    I have a directory with 50 (Excel 2013) .xlsx files. I'm changing content of these workbooks often and send these to someone once updated. Before I send, I have to password protect each file. I have tried using Winzip password protection as a solution but due to the client having restrictions on their environment they are unable to use this.

    Some key points:
    The workbook names will never change.
    The password can be the same for all workbooks.
    The directory folder only contains the 50 workbooks.

    What I am after:
    A way of adding a password to all workbooks before I send them rather than having to manually go into each one to apply a password.
    A way to remove the password once I receive the files back (to make it easier for me to work with).

    I have thought about possible solutions:
    Creating a excel workbook that lists all the names (listed in column A) of the workbooks in the directory. Then using this list with a Module that cycles through each value in column A, opens the spreadsheet and applies password "test" before saving and closing, moving onto the next file.

    Not too sure how to do this however as I am no expert in VBA.

    If anyone can shed some light on a solution I wont be able to thank you enough.

    Kindest Regards,

    Sam

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Protecting multiple workbooks in a directory - Automation

    Hi,

    These macros should lock and unlock all excel files in a directory, password is "test"

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    10-26-2015
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Re: Protecting multiple workbooks in a directory - Automation

    Sweep, works like an absolute charm.

    Thank you so very much for your time and help.

    Kindest regards,

    Sam

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Protecting multiple workbooks in a directory - Automation

    Hi,

    Just an addenum as rightly suggested by LJMetzger , the addition of

    Please Login or Register  to view this content.
    to disable rogue Workbook_Open() occurrences

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Protecting multiple workbooks in a directory - Automation

    Hi,

    Just an addenum as rightly suggested by LJMetzger, the addition of

    Please Login or Register  to view this content.
    to disable rogue Workbook_Open() occurrences

+ 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. VBA for multiple workbooks in a directory
    By jone kim in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2014, 09:17 PM
  2. Open multiple workbooks in directory, copy a range to them for data collection
    By agutman50 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-28-2014, 01:24 PM
  3. Sort first column of multiple workbooks from a single directory
    By lmolokin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2012, 05:15 PM
  4. Replies: 0
    Last Post: 01-21-2012, 11:48 PM
  5. Copying range into multiple workbooks in a directory
    By tinkerbelle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2007, 04:43 AM
  6. Protecting Multiple Workbooks?
    By Bosco in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2005, 03:06 PM
  7. header onto multiple workbooks in same directory
    By AmyTaylor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2005, 07:17 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