A Python utility that safely removes password protection from Excel worksheet sheets without requiring the original password. Uses string-based pattern matching to preserve file integrity and prevent data corruption.
- ✅ Safe & Reliable - Uses string replacement instead of XML parsing to prevent corruption
- 🔍 Inspection Mode - Preview protected sheets before making changes
- 💾 Automatic Backup - Creates backup files before any modifications
- 🛡️ Data Preservation - Maintains all formulas, formatting, and content
- 📊 Multiple Sheet Support - Handles workbooks with multiple protected sheets
- ✔️ File Integrity Check - Verifies output file validity
.xlsx(Excel Workbook).xlsm(Excel Macro-Enabled Workbook)
Removes sheet-level protection that prevents users from:
- Editing cells
- Inserting/deleting rows and columns
- Formatting cells
- Modifying sheet structure
Note: This tool removes sheet protection only, not workbook protection or file encryption.
- Install Python 3.7+ with PATH enabled
- Download
remove_sheet_protection.py - Run:
python remove_sheet_protection.py - Follow the prompts
See the full setup guide in README.txt for detailed installation instructions.
This tool is intended for legitimate use only. Only use on Excel files you own or have explicit permission to modify. Users are responsible for compliance with their organization's policies and applicable laws.
- Python 3.7 or higher
- No additional dependencies required (uses built-in libraries only)
=============================================================================== EXCEL SHEET PROTECTION REMOVER Setup and Usage Guide
A Python script that safely removes password protection from Excel sheets without knowing the password. This tool preserves all data, formulas, and formatting while removing sheet-level protection.
- ALWAYS BACKUP YOUR FILES - While this tool creates automatic backups, keep your own copies
- SHEET PROTECTION ONLY - This removes sheet protection, not workbook protection or file encryption
- Python (we'll install this)
- The script file (remove_sheet_protection.py)
- Your protected Excel file (.xlsx or .xlsm)
=============================================================================== STEP 1: INSTALL PYTHON
- Go to https://www.python.org/downloads/
- Click the big yellow "Download Python" button
- This will download the latest version (3.11+ recommended)
-
Run the installer you just downloaded
-
BEFORE clicking "Install Now" - Look at the bottom of the installer window
-
CHECK THE BOX that says "Add Python to PATH" or "Add Python to environment variables"
*** THIS STEP IS CRUCIAL *** Without it, you won't be able to run Python from Command Prompt
-
Click "Install Now"
-
Wait for installation to complete
-
Click "Close" when done
- Press Windows Key + R
- Type cmd and press Enter
- In the black Command Prompt window, type: python --version
- You should see something like: Python 3.11.4
If you get an error like "'python' is not recognized", you need to reinstall Python and make sure to check the "Add Python to PATH" box.
=============================================================================== STEP 2: GET THE SCRIPT
- Save the script - Copy the remove_sheet_protection.py file to a folder on your computer
- Recommended location: C:\Users\YourName\Documents\ or your Desktop
- Note the full path - you'll need to navigate here in Command Prompt
=============================================================================== STEP 3: RUN THE SCRIPT
- Press Windows Key + R
- Type cmd and press Enter
- A black window (Command Prompt) will open
If you saved the script to your Documents folder: cd C:\Users\YourName\Documents
Replace YourName with your actual Windows username. For example: cd C:\Users\john.smith\Documents
Type this command and press Enter: python remove_sheet_protection.py
=============================================================================== STEP 4: USING THE TOOL
-
File Path Prompt: Enter full path to the .xlsm/.xlsx file:
TIP: You can drag and drop your Excel file into the Command Prompt window to automatically insert the full path!
-
Inspection Option: Do you want to inspect the file first to see what protection exists? (y/n):
- Type y and press Enter to see what's protected before making changes
- Type n to skip inspection and proceed directly
-
Review Results: The tool will show you:
- Which sheets were protected
- What type of protection was removed
- Where the new unprotected file was saved
Enter full path to the .xlsm/.xlsx file: C:\Users\john\Documents\MyFile.xlsx Do you want to inspect the file first? (y/n): y Backup created: C:\Users\john\Documents\MyFile.xlsx.backup Extracting Excel archive... Mapping sheet names...
INSPECTION MODE - Analyzing protection elements: Found 3 worksheet files
Inspecting sheet1.xml: No protection elements found
Inspecting sheet2.xml: sheetProtection (self-closing): 1 found
Inspecting sheet3.xml: sheetProtection (self-closing): 1 found
Do you want to proceed with removing the protection? (y/n): y
Removing protection from sheets... Successfully unprotected 2 sheet(s): • Data Sheet (sheet2.xml) • Analysis (sheet3.xml)
Creating unprotected file... Done! New file created: C:\Users\john\Documents\MyFile_unprotected.xlsx File integrity verified
The tool creates several files:
- OriginalName_unprotected.xlsx - Your unprotected Excel file
- OriginalName.xlsx.backup - Automatic backup of original file
Problem: Python wasn't added to PATH during installation Solution: Reinstall Python and check the "Add Python to PATH" box
Problem: Wrong file path or file doesn't exist Solution:
- Double-check the file path
- Try dragging and dropping the file into Command Prompt
- Make sure the file exists and isn't open in Excel
Problem: Different type of protection (workbook protection, file encryption) Solution: This tool only removes sheet-level protection
Problem: Rare issue with complex Excel files Solution:
- Use the backup file created automatically
- Try the inspection mode first to see what's being modified
Problem: File is open in Excel or read-only Solution: Close Excel completely and ensure the file isn't read-only
- Automatic Backup: Creates .backup file before any changes
- Inspection Mode: Preview what will be changed before proceeding
- File Integrity Check: Verifies the output file is valid
- Safe String Method: Uses text replacement instead of XML parsing to prevent corruption
- Error Recovery: Attempts to restore original content if errors occur
- Close Excel completely before running the tool
- Use inspection mode first to see what protection exists
- Test the output file before deleting backups
- Keep the backup files until you're sure everything works
- Run from a simple folder path (avoid spaces and special characters in folder names)
=============================================================================== SHARING WITH COLLEAGUES
When sharing this tool:
- Share both files: remove_sheet_protection.py and this README
- Emphasize the Python installation step - the PATH checkbox is critical
- Recommend testing on a copy first
=============================================================================== QUICK REFERENCE COMMANDS
| Task | Command |
|---|---|
| Check Python is installed | python --version |
| Navigate to Documents | cd C:\Users\YourName\Documents |
| Run the script | python remove_sheet_protection.py |
| Go back one folder | cd .. |
| See current folder contents | dir |
If you run into issues:
- Double-check Python installation - especially the PATH setting
- Try the inspection mode to see what the tool finds
- Check file permissions - make sure the file isn't read-only or open
- Use the backup file if something goes wrong
Remember: This tool has been tested and works reliably, but always keep backups of important files!
===============================================================================