Unprotect a workbook via macro?

userpoets

New Member
Joined
Mar 21, 2019
Messages
8
Good afternoon everyone, I have ten separate spreadsheets that I need to collate into one main tracking file. The issue I'm running into is that each of the individual files is read-write protected, specifically that a password needs to be entered to even view the file.

Right now when I open my main tracking file, to get the updated information I have to hit "enable content" and then manually type in ten passwords (really the same password ten times), and I was trying to figure a macro that would do all of this automatically for me, but I'm really not sure where to begin. My previous Excel endeavors have always involved unlocking an individual sheet or opening edit access, and this concept really has me stumped.

Any help is appreciated!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
It is not totally clear what you have. Are there ten separate worksheets in one workbook (file) or ten workbooks (files) containing one worksheet each?

Assuming ten workbooks (files) with one worksheet the simple answer is that you need a macro in the "main tracking file" (workbook) that opens a protected workbook and then unprotects the respective workbook. Once opened this is the code needed to unprotect with the password looks something like Workbooks("myworkbook").Unprotect "password"

I'll try to help if the task is clearer.
 
Upvote 0
I apologize for the absence, and I appreciate your response.

There are ten separate worksheets that are feeding information to one master sheet. All sheets are confidential to anyone but myself and my supervisor, so they are protected both from opening and editing.

I was hoping I could use something similar to this, which I have used to open read-only sheets in edit mode, update their data, then save and close:

Workbooks.Open "='C:\Users\userpoets\Desktop\Audits\Userpoets.xlsx", WriteResPassword:="unprotect", ReadOnly:=False, UpdateLinks:=True

However, this particular line of macro will open the document but will not auto-enter the password for me like I'm trying to do.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top