When you try to open a VBA created by someone else, you might encounter a situation where the VBA is password-protected and cannot be viewed.
Or, even if it's VBA that you created yourself, there are cases where you forget the password and can no longer open it.

In such cases, you can use this method to unlock it.
You can also refer to these for other password reset methods.


Prepare a binary editor
To perform this operation, you need to open a ".bin" file using a binary editor. In most cases, you probably won't have this software, so let's download it first.
If you search for "binary editor" or similar terms, you will find them.

Change the extension to ".zip"
First, please copy the relevant Excel file and create a backup. If you fail in the subsequent operations, there's a possibility it will become impossible to open.
1. As shown in the diagram below, change the Excel file extension from ".xlsm" to ".zip".

2. A warning screen like the one below will appear, so click "Yes."

3. The Excel file will then change to a ".zip" file.

Extract "vbaProject.bin" from the zip file
Double-click the ".zip" file created above to open it and then open the folder named "xl".

2. Copy the "vbaProject.bin" file to another location.

Process the "vbaProject.bin" file
Open "vbaProject.bin" with the binary editor you downloaded

If ReadOnly is checked, click to uncheck it.

Search for "DPB"

Replace one of the letters in "DPB" with another letter. Pressing the letter keys while holding down Shift will work.

Save and close "vbaProject.bin."

Return the "vbaProject.bin" file to the original ".zip" file folder

Click on "Copy and Replace."

Open Excel
Change the extension of the processed ".zip" file back to ".xlsm"

Open the Excel file that was being processed.

An error message like the following appears when I open Excel. It's okay if the name I just changed appears as an "invalid key."

If you see an error with a different string here, it's highly likely you've made a mistake somewhere, so please start over from the beginning.
Open it, save it immediately, and close Excel.

When I open Excel again, the VBA password is removed.


Comment