Forum Discussion
Help with Protect Sheet
- May 02, 2021
As long as you're not talking about cracking an encrypted file, which would be illegal, and only talking about the restrict editing password as you say--then don't worry. Restrict editing passwords are very easy to remove in both Word and Excel.
Here is what you need to do. Make sure that you have enabled seeing file extensions in folders options. Then, change the file extension of the Excel to .zip from .xlsx. Next, open that zip file.
Where you go from here depends on which restriction you enabled.If it was for the whole workbook:
- Open the workbook.xml file and find the xml node that begins "<workbookProtection" like this.
- Highlight from the < character through to the > character following the word "lockStructure" (inclusive) and delete it. That will unlock the workbook.
- Replace the xml in the zip with your changed file, and change the .zip back to .xlsx.
If it is just the sheet:
- Look in the xl folder for the sheet.xml file for your sheet.
- This time find the node beginning "<sheetProtection" through the > following the word "scenarios". Delete that, and this will unlock the sheet.
- Replace the xml in the zip with your changed file, and change the .zip back to .xlsx.
I've written a PowerShell script that will ask you to point it at a folder and loop through all the Word and Excel files therein, removing the restrict editing passwords to all of them. I can provide this to you if you like. I am unable to sign my scripts though, so I understand if you'd rather not run a strangers code on your machine. That said, I am not malicious, and if you'd like to use it I am willing to provide it to you. Nobody else uses it, and I wrote it just to see if I could while messing around with PowerShell.
Okay. Make a copy of your Excel before you make any changes. Then delete all of:
<sheetProtection algorithmName="SHA-512" hashValue="0y8I1nW5880WNsyH+bqK5hWSNfLCcBWxl0st+jw//y64jBxqNUdGncS7QZTwR/DnqwcGjOqpmRLIWtDp5AUxHw==" saltValue="+j12ZWsg7o3dKbkM1nHCgQ==" spinCount="100000" sheet="1" selectLockedCells="1" selectUnlockedCells="1"/>
That should do it. I think this scenario might be slightly different from what I described because of what specifically was locked. But just delete that bit and try it.
Thank you sooooo much!!!!!
I appreciate it more than you will ever now!
Enjoy the rest of your Sunday!
- Rich89May 02, 2021Brass ContributorOh, and don't forget to mark your thread as solved. That way in the future if someone comes looking they can find your solution.
- BowenR1May 02, 2021Copper ContributorLOL...how?
- Rich89May 02, 2021Brass ContributorThere should be an option under the posts to "mark as best response" I believe. Pretty sure that's what does it. I don't think it really matters which one you choose in this case since it was just you and I responding to each other.
- Rich89May 02, 2021Brass ContributorI'm very happy to help! And you've helped me as well. I've learned there are exception to how the xml node reads and that gives me a project to do on my script because my script would not have worked here.
Have a great day. 🙂