Python command line application to unlock Microsoft Office password protected files.
craXcel ("crack-cel") is a tool that makes removing various password protections from Microsoft Office files seemless. It works by directly amending the underlying XML files that make up modern Microsoft Office files.
Please note that craXcel cannot unlock encrypted files.
As of V2.0:
- Microsoft Excel (workbook, worksheet, vba)
- .xlsx
- .xlsm
- Microsoft Word (modify, format, vba)
- .docx
- .docm
- Microsoft Powerpoint (modify, vba)
- .pptx
- .pptm
Others may work, but have not been tested.
Upon unlocking the VBA Project of a Macro Enabled file, that file will state it has encountered issues and needs to recover... DO NOT PANIC, this is normal.
The steps to follow to complete the unlock is as follows:
- Open the unlocked file and click 'Enable Content' on the warning:
- Click 'OK' on the following pop-up:
- Open Visual Basic from the Developer toolbar:
- Open VBAProject Propeties under Tools:
- Navigate to the Protection tab and enter a new password (a one character password is fine, as we will be removing it again straight away). Click 'OK'.
-
Head back in to VBAProject Properties > Protection tab, and de-select the 'Lock project for viewing' checkbox and clear any passwords in the boxes below. Click 'OK'.
-
The modules will now be unlocked and you can save the document without having to repeat these steps.
Note to developers: If you're willing to take on the challenge of automating these steps (preferably without user input mimicking...) you are welcome to contribute!
- Download and install Python (v3+) (https://www.python.org/downloads/)
- Clone or download the repository from GitHub to a local folder of your choosing
- Open a terminal of your choice (i.e. cmd, powershell, bash)
- In the terminal navigate to the folder with craxcel (from step 1)
- If you're not familiar with how to do this, search online for: "[name of terminal] change directory"
- In the terminal, enter the command: pip install -r requirements.txt
- If you have trouble, try opening the terminal as an administrator
- You are now good to go! Refer to the Usage section below for instructions on how to use craXcel
- Guide to Downloading and Installing Python (https://realpython.com/installing-python/)
- Cloning a GitHub Repository (https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
- Open a terminal of your choice (i.e. cmd, powershell, bash)
- In the terminal, navigate to the folder with craxcel
- In the terminal, enter the command: python craxcel.py yourfilename.xlsx
- The terminal doesn't necessarily have to be in the same folder as craxcel, and nor does your file
- If craxcel is not located in the current directory, simply give the terminal the full path, i.e.:
- python 'c:/users/me/downloads/craxcel/craxcel.py' yourfile.xlsx
- The same applies in the case of your file, simply give the terminal the full path, i.e.:
- python craxcel.py 'c:/users/me/documents/yourfile.xlsx'
- And you can, of course, combine these for both if required, i.e.:
- python 'c:/users/me/downloads/craxcel/craxcel.py' 'c:/users/me/documents/yourfile.xlsx'
- The unlocked file will be saved in the created 'unlocked' folder where the app is installed
craXcel also has the ability to unlock multiple files at a time!
- Create a .txt file with a line for each filepath (see file-list-example.txt for an example)
- Instead of entering the filename of an individual Microsoft Office application, enter the .txt filename
- Finish the command by entering '--list', i.e.
- python craxcel.py 'c:/users/me/documents/list-of-files.txt' --list
- craXcel has several options that can be passed in for more advanced uses, i.e.:
- Unlock the VBA Project (macro file) of a macro enabled file
- python craxcel.py yourfile.xlsm --vba
- Selecting to only remove Workbook protection (leaving Worksheet protection intact)
- python craxcel.py yourfile.xlsx -wb
- Selecting to only remove Worksheet protection (leaving Workbook protection intact)
- python craxcel.py yourfile.xlsx -ws
- Run without deleting the temporary XML files
- python craxcel.py yourfile.xlsx --debug
- Unlock the VBA Project (macro file) of a macro enabled file
- For a full list of options, enter the command: python craxcel.py --help
If you have a feature you would like to see you can either raise an issue in the GitHub repository, or branch off and give it a go yourself!