Excel Guide

How to Remove a VBA Project Password in Excel

Updated July 2026 4 min read For macro users

Double-click a module in the VBA editor and get hit with "Project is unviewable" or a password prompt? That's a VBA project password — a lock on the macro code, not on the file. Here's how to remove it for free, without the old Hex-editor trickery.

Why a VBA password can be removed without knowing it

The VBA project password only tells Excel to hide the code from view. Crucially, the macros themselves are stored unencrypted inside the file — the password just flips a "protected" flag and stores a hash. Because the code isn't encrypted, the lock can be removed cleanly without ever recovering the original password. That's why this takes seconds, not brute-force hours.

Remove it online with XLockFree

  1. Open the XLockFree unlocker. Runs in any browser — nothing to install.
  2. Upload your macro file. Drop your .xlsm, .xlam or .xltm file onto the page. Leave the password field blank.
  3. Click "Unlock & Download". XLockFree patches the VBA project to remove the password and downloads the fixed file. Look for the VBA badge confirming it was cleared.
  4. Open the file and press Alt + F11. The VBA editor now opens your project directly — no password prompt, code fully visible and editable.

Your macros are intact. XLockFree only removes the protection flag — every line of your VBA code is preserved and runs exactly as before. You're simply able to see and edit it again.

The old manual method (and why to avoid it)

Before online tools, the common trick was to open the file in a Hex editor and manually change the protection keys inside the vbaProject.bin stream — swapping DPB for DPx and so on. It works, but:

  • A single wrong byte corrupts the whole file.
  • The exact keys differ between Excel versions.
  • It doesn't handle the compressed VBA directory correctly, so newer files often break.

XLockFree performs the correct, version-aware edit — decompressing the VBA directory, clearing the protection record, and recompressing it — automatically and losslessly. Same result, none of the risk.

💡

Good to know: If your .xlsm also has sheet protection or is encrypted, XLockFree clears those in the same pass — you don't need to run it twice.

Troubleshooting

The VBA editor still shows the project as locked

Confirm you opened the downloaded unlocked_ file, and that the VBA badge appeared after processing. If the file was also encrypted, enter the open password first so XLockFree can reach the macro project inside.

Nothing happens when I press Alt + F11 on Mac

On macOS the shortcut is Fn + Alt + F11, or open the editor from Tools → Macro → Visual Basic Editor.

Unlock your VBA project now

Free, private, no sign-up — your file is never stored.

Open XLockFree →

Frequently asked questions

Can I remove a VBA project password without knowing it?

Yes. The VBA password protects viewing of the code, not the file, so it can be removed without the original password. Upload the .xlsm to XLockFree and it strips the VBA password automatically.

Will my macros still work after removing the password?

Yes. Only the lock is removed — the macro code is untouched and runs exactly as before. You can now view and edit it.

Do I need a Hex editor to unlock VBA?

No. XLockFree performs the correct edit automatically in your browser, avoiding the risk of the manual Hex method.

Which file types have VBA passwords?

Macro-enabled files: .xlsm, .xlam and .xltm, plus legacy .xls. XLockFree supports all of them.