How to Remove Excel Passwords: Sheet, Workbook, Read-Only, and VBA Project
This tutorial demonstrates practical, non-destructive methods for removing different levels of Excel protection without using expensive commercial password-cracking software.…
Watch the video tutorial on YouTube
Overview
This tutorial demonstrates practical, non-destructive methods for removing different levels of Excel protection without using expensive commercial password-cracking software. Modern Office Open XML workbooks (.xlsx, .xlsm) operate as compressed ZIP archives containing directory trees of XML and binary files. By renaming the file extension to .zip and extracting the package contents, users can modify the underlying configuration markup directly. The video walks through resolving four common protection scenarios: removing individual worksheet protection by deleting the <sheetProtection> XML element, removing workbook structure protection by setting the lockStructure attribute to 0, and bypassing read-only modification prompts by clearing the <fileSharing> tag. It also covers the advanced hex-editing technique required to reset locked VBA project passwords using HxD Hex Editor, alongside Windows Defender/Office 365 MOTW (Mark of the Web) unblocking.
Introduction and Preparation
00:00
Excel files built on the OpenXML format package their settings, sheets, and macros within an archive. Before attempting to alter any underlying XML or binary files, always create a duplicate copy of the target file. Additionally, files downloaded from email or the web often trigger Microsoft 365 Mark-of-the-Web (MOTW) blocks. To avoid issues, right-click the workbook, choose Properties, check 'Unblock' under the General security tab, and apply changes before proceeding.
- Always preserve an untouched backup copy of your original file.
- Unblock downloaded files via Windows Properties to prevent Office 365 security auto-blocking.
Ctrl + A
Removing Worksheet Protection via XML Editing
00:27
When a specific worksheet has protected cells or ranges, the protection settings are declared inside the corresponding sheet XML. Change the file extension from .xlsx/.xlsm to .zip and extract the contents. Navigate to 'xl/worksheets/' and locate the targeted sheet (e.g., sheet1.xml). Open the XML file in a text editor (like VS Code or Notepad), search for 'sheetProtection', and highlight the complete tag from '<sheetProtection' to its closing '/>' (or closing tag). Delete the tag entirely, or change sheet, objects, and scenarios values to 0. Save the file, replace it inside the archive, re-compress the four root items into a new ZIP archive, and rename the extension back to .xlsx/.xlsm.
- Worksheet XML files reside inside the 'xl/worksheets/' folder.
- Remove the entire '<sheetProtection ... />' element to clear sheet-level restrictions.
- Re-compress the root files (.rels, docProps, xl, [Content_Types].xml) directly into the new ZIP.
Ctrl + F
sheetProtection
Removing Workbook Structure Protection
04:26
Workbook protection prevents users from inserting, deleting, renaming, or viewing hidden sheets. To remove it, rename the file to .zip and extract the package. Go to the 'xl/' directory and open 'workbook.xml' in a text editor. Use Ctrl+F to search for 'workbookProtection' or 'workbookpro'. Locate the 'lockStructure' attribute and change its value from 1 to 0 (or remove the entire workbookProtection node). Save the modified file, re-zip the root package files, and restore the original extension (.xlsm or .xlsx). The workbook structure will now be completely editable.
- Workbook-level structure settings are stored in 'xl/workbook.xml'.
- Change 'lockStructure="1"' to 'lockStructure="0"' to disable structure locking without breaking references.
Ctrl + F
workbookProtection
lockStructure="0"
Bypassing Read-Only Modification Passwords
07:27
Excel workbooks configured with a password to modify prompt the user with a Read-Only dialog upon launch. To remove this prompt, convert the workbook to a .zip archive and extract it. Inside the 'xl/' directory, open 'workbook.xml' with your text editor. Search for the string 'fileSharing'. Highlight and delete the entire '<fileSharing ... />' node from opening bracket to closing tag. Save the file, re-compress the root folder contents into a ZIP file, and rename the extension back to the appropriate Excel format. The file will now open directly in read-write mode.
- Read-only modify passwords reside inside the '<fileSharing />' element of 'xl/workbook.xml'.
- Deleting the '<fileSharing>' element completely eliminates the modify password challenge on startup.
Ctrl + F
fileSharing
Unlocking Password-Protected VBA Projects using Hex Editing
10:29
VBA project protection is compiled in a binary stream rather than plain XML. Extract the workbook archive and locate 'xl/vbaProject.bin'. Open this binary file using a dedicated hex editor such as HxD Hex Editor. Search for the text string 'DPB'. Without using backspace or deleting bytes (which would alter file offsets and corrupt the stream), highlight the 'DPB' bytes and change the value to an invalid key such as 'DPG' or 'DBx'. Save the file, re-zip the folder contents, and rename to .xlsm. When opening the workbook, dismiss all recovery and unexpected error dialogs by clicking Yes/OK. Open Developer > Visual Basic, go to Tools > VBAProject Properties > Protection, uncheck 'Lock project for viewing', clear any password boxes, and save. To prevent persistent error prompts, perform a 'Save As' and replace the file to allow Excel to compile clean VBA headers.
- VBA code is compiled into 'xl/vbaProject.bin' and requires a hex editor (e.g., HxD).
- Never delete or insert bytes in the hex editor; overwrite 'DPB' in-place (e.g., to 'DPG') to preserve byte offsets.
- After bypassing the initial error, clear the protection in VBA project properties and Save As to recompile the project cleanly.
DPB
Tools > VBAProject Properties > Protection
File Open Encryption vs Archive Modification
14:38
The presenter distinguishes between internal container restrictions and full file-open encryption ('Encrypt with Password'). File-open encryption uses cryptographic algorithms (such as AES) that encrypt the entire container, meaning the file cannot be extracted as a standard ZIP archive. Bypassing file-open encryption requires the original password to decrypt before removing protection via File > Info > Protect Workbook.
- Zip-based XML modifications only work on unencrypted containers with internal feature locks.
- Full 'Encrypt with Password' / File Open passwords encrypt the entire archive stream and cannot be bypassed via ZIP extraction.
File > Info > Protect Workbook