+ Reply to Thread
Results 1 to 4 of 4

VBA to open the list of excel files and save with password

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    713

    VBA to open the list of excel files and save with password

    Hi Team,

    I have split of 100 files and need to do a password protect all of them. Can this be done via macro. Password remains same for all the files.

    Kind Regards,
    Keep the Forum clean :


    1. Use [ code ] code tags [ /code ]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. Show appreciation to those who have helped you by clicking * Add Reputation below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: VBA to open the list of excel files and save with password

    This is one way. Assume your file names are listed in column A.

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    713

    Re: VBA to open the list of excel files and save with password

    Thanks JLGWhiz,

    Macro opens up the file, but password is not set. It just closed the file by opening it.

    Please advise.

    Thanks,

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: VBA to open the list of excel files and save with password

    This should work.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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. [SOLVED] Save/Closed only macro related files and leave unrelated files open in excel?
    By rdowney79 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-12-2013, 04:17 PM
  2. [SOLVED] Open password protected files in folder using list of passwords
    By Shift-4 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-22-2013, 06:08 PM
  3. one folder & so many excel files are save, i want name change without open excel files
    By sonu_kumar444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2013, 03:45 PM
  4. How to Save As a password-to-open workbook without a password?
    By ncalkins in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2012, 07:02 PM
  5. Replies: 1
    Last Post: 01-31-2012, 09:07 PM
  6. [SOLVED] How do i save all open files in excel at once?
    By ved_rocker in forum Excel General
    Replies: 2
    Last Post: 02-16-2006, 06:20 PM
  7. [SOLVED] How do I save a password protected Excel doc in order to open?
    By Stamperfiend in forum Excel General
    Replies: 4
    Last Post: 08-25-2005, 07:05 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