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 Project

How 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:

  1. Locate DPB= in the binary data
  2. Change it to DPx= — this invalidates the hash
  3. 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:

  1. Excel may show a warning: "The VBA project properties key is invalid" — click OK
  2. Open the Visual Basic Editor (Alt + F11)
  3. You can now expand the project and view all modules, forms, and class modules
  4. 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:

  1. Rename your .xlsm to .zip
  2. Extract the archive
  3. Open xl/vbaProject.bin in a hex editor
  4. Search for the bytes 44 50 42 3D (ASCII: "DPB=")
  5. Change 42 to 78 (changes "B" to "x")
  6. 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

Related Guides