Closed Thread
Results 1 to 4 of 4

Run a macro on Multiple Workbooks to remove open password.

  1. #1
    abhay_547
    Guest

    Run a macro on Multiple Workbooks to remove open password.

    Hi All,

    I have the below macro which opens a file from a directory and removes it's password and then saves it back on the same directory. Now I have excel workbook where I have a list of files in column A and there Passwords in Column B and Action to be taken in Column C .i.e. Remove Password. I want to the below macro to loop through the list of the files in Column A and open the workbooks and remove the passwords of those workbooks where in Column C against it is mentioned to remove password.

    Please Login or Register  to view this content.
    And Below is the code which I have which can run the macro on all files present in a directory

    Please Login or Register  to view this content.

    Please find the attached macro file.

    Thanks a lot for your help in advance.
    Attached Files Attached Files
    Last edited by abhay_547; 10-24-2010 at 11:45 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,378

    Re: Run a macro on Multiple Workbooks to remove open password.

    Hi abhay_547,
    Your request is over my pay grade. It seems you want to remove passwords from Excel files that were password protected. Even if I knew how to do this, I'd have moral concerns on doing it. It is like me asking you for your personal password and bank account numbers. If you wanted them to be private, you don't want someone else writing a little code to break into your personal stuff.

    This is the first Forum Question I've ever said NO to. My answer is NO! We should not give you help breaking into passwords.

    Sorry to have to explain my moral dilemma.

    It seems funny that my icon is the Martian who wanted to blow up the Earth with his ray gun. My character would be the last one to suggest morals to breaking passwords.
    Last edited by MarvinP; 10-19-2010 at 12:26 PM.

  3. #3
    abhay_547
    Guest

    Re: Run a macro on Multiple Workbooks to remove open password.

    Hi Marvin,

    Thanks a lot for your reply but I am not asking to break any password. I have passwords for all workbooks in a excel sheet in ColumnB and in Column A I have workbook names. I just want the macro to open those workbooks using the password present in Column B and then while saving remove that password programmatically. This I want to do because I want to save the manual effort of opening and closing multiple workbooks. I have already mentioned all this things in my earlier post. Please read the post properly before responding to the same.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,378

    Re: Run a macro on Multiple Workbooks to remove open password.

    Hi abhay,

    I'm sorry for the rant above. I was thinking about intellectual property not being what it should be.

    I just recorded a macro that protected a workbook and then unprotected it.

    Look in the Object Browser for Workbook.Unprotect . It looks like there is an optional parameter of password. You are in luck. Read the description of the Password. It is a string and must be case sensitive.

    I think you can figure it out from here.

Closed 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