How to Remove a VBA Macro Project Password in Excel
Updated March 2026 · 5 min read
VBA project passwords prevent you from viewing or editing macro code in Excel. They're commonly used to protect proprietary business logic, but can become a problem when the original developer is unavailable and you need to update legacy macros. Here's how to remove them.
What Is a VBA Project Password?
When you open the Visual Basic Editor (Alt + F11) and try to expand a project, Excel prompts for a password. This is the VBA project password — it protects thevbaProject.bin file inside the workbook's ZIP archive.
Unlike file-open encryption (AES-256), VBA project passwords use a weaker protection mechanism. The password hash is stored in the binary file and can be invalidated without knowing the original password.
Remove VBA password instantly
Upload your .xlsm file and XL Unlocker will remove the VBA project password along with any other protections — all in your browser.
Unlock VBA ProjectHow the Removal Works
Inside every .xlsm (or .xlsx with macros) file, there's a binary file calledvbaProject.bin. This file contains a property called DPB= which stores the hashed password.
The technique:
- Locate
DPB=in the binary data - Change it to
DPx=— this invalidates the hash - When Excel opens the file, it detects the corrupted key and clears the protection
XL Unlocker does this automatically as part of its processing pipeline. Your macro code is left completely intact — only the password hash is invalidated.
After Unlocking: What to Expect
When you open the unlocked file in Excel:
- Excel may show a warning: "The VBA project properties key is invalid" — click OK
- Open the Visual Basic Editor (Alt + F11)
- You can now expand the project and view all modules, forms, and class modules
- To fully clear the old password: go to Tools → VBAProject Properties → Protection tab, uncheck "Lock project", and save
Important note
After the initial warning, save and reopen the file once more. The warning will not appear again, and the VBA project will be fully accessible.
Manual Method (Advanced)
If you prefer to do this manually:
- Rename your .xlsm to .zip
- Extract the archive
- Open
xl/vbaProject.binin a hex editor - Search for the bytes
44 50 42 3D(ASCII: "DPB=") - Change
42to78(changes "B" to "x") - Save, re-zip, and rename back to .xlsm
Or just use XL Unlocker and skip all of that.
Common Use Cases
- Legacy macro maintenance — the original developer left and nobody has the password
- Auditing VBA code — security review of macros in received files
- Migrating macros — extracting VBA code to move to a modern platform
- Educational purposes — learning from existing macro implementations