Unlock VBA Password in Excel 2013: 5-Min Hex Hack
At a Glance
- Target Audience
- Excel Developers, Office 365 Admins, Business Analysts
- Problem Solved
- Forgotten VBA project password blocking access to critical macros in legacy Excel 2013 files.
- Use Case
- Recovering inherited Excel workbooks with locked VBA for essential business automation.
You inherit a legacy Excel file from a former employee. It runs a critical business process. But the VBA code is locked behind a password nobody remembers.
Panic usually sets in here. People start looking for expensive recovery software. Stop doing that. You do not need to buy a sketchy third-party tool to regain access to your own data. You just need a hex editor and five minutes of boring work.
Visual Basic for Applications (VBA) powers automation across Microsoft Office apps like Word, PowerPoint, Excel, and Access. Developers password-protect these macros to prevent accidental edits. That is a smart move until the creator leaves the company and takes the password with them.
Here is the hard truth. Excel's legacy password protection is an illusion. This bypass method works reliably for older binary formats like Excel 2013 and earlier.
Before we fix the locked file, it is worth noting that managing complex Excel macros often leads to broader architectural questions. Eventually, you might want to move away from local macros entirely, but right now, your priority is getting back into your code.
Here is the exact process.
First, download a hex editor. The XV132 Hex editor is a classic choice for this task.
Next, prep your file. If you are working with a modern .xlsm file, open Excel and save it down to the older .xls format. Make a backup copy. Never edit your only master file.
Open the .xls file inside your hex editor.
You are looking for a specific text string. Use the search function to find "DPB" in the code.
This string flags the VBA password protection tag in Excel.
Now trick the system. Change the "B" to an "X" so the string reads "DPX". This simple edit breaks the password validation logic. Save your changes and close the hex editor.
Open your modified .xls file normally in Excel. You will see an error message popup. Do not panic. Just click "Yes" or "OK" to push past it.
The final step is to strip the broken password entirely. Press Alt+F11 to open the Visual Basic Editor. Go to the View menu and select Project Explorer. Right-click your VBA Project and select VBA Project Properties. Navigate to the Protection tab, clear out any text in the password fields, uncheck the lock box, and hit OK.
Save the file. You now have full access to the source code.
Security is only as strong as its foundation. Relying on legacy Excel passwords is a risk. Fix the immediate problem today, but start planning your migration to better tools tomorrow.

