Date: 2018-05-03
Author: Simon Jackson
Over the past couple of weeks, I’ve had to do a bit of spreadsheet password cracking. So I thought I’d share with you all some of the methods that worked for me.
Prerequsites:
Write access to the file system
Ensure the file is not marked as read-only
If you downloaded files from the web, it may be marked as read-only by the IE Trust Zones (see file properties in windows explorer)
These files were files saved in Office 2010+ XML format.
Method:
Open the VBA Editor (ALT + F11)
Double click on ANY sheet name
Paste in this code on the right
Select the top line, then click F5 to run it
Copy the password out of the prompt (if you need it)
Method:
Open the VBA Editor (ALT + F11)
Double click on the sheet name
Paste in this code, then click F5 to run it.
Copy the password out of the prompt (if you need it).
Notes:
Repeat the above step for each locked worksheet within the workbook
Worksheet password protection will be removed by this code.
Method:
Save the Spreadsheet to an older 2000/2003 version of XLS.
Double check the filename ends in XLS NOT XLSX
Install HexEdit or other HEX editor (you can download this from here)
Right click on the spreadsheet in windows explorer, choose “Open with Hex Edit”
Once open, launch a search (Ctrl+F) and type “DPB”
Change this for the text “DPX”, and save the file again
You can close Hex Edit.
Open the XLS file in excel again.
Launch the VBA editor (ALT+F11)
Double click on the project (top-left)
You should get an error message
Click OK to continue.
If you set a new password manually, this message will never re-surface.
Right click on the Project, Select Properties and Select the Protection Tab to set your own password.
Notes:
Repeat the above step for each locked worksheet within the workbook
Worksheet password protection will be removed by this code.
Hope this helps someone...