How to remove Password from VBA Project in Excel

Step-by-step procedures

For XLSM files

  1. Open the XLSM file with 7-Zip (right click -> 7-Zip -> Open archive).
  2. Copy the xl/vbaProject.bas (or .bin) file out of the file (you can drag and drop from 7-Zip), don’t close 7-Zip
  3. Open the vbaProject.bas (or .bin) file with HexEdit
  4. Search for “DPB=” and replace it with “DPx=”
  5. Save the file
  6. Copy this file back into 7-Zip (again, drag and drop works)
  7. Open the XLSX file in Excel, if prompted to “Continue Loading Project”, click Yes. If prompted with errors, click OK.
  8. Press F11 to open the VBA editor.
  9. Right click on the VBA project, select properties. Open the Protection tab then uncheck “Lock project for viewing”. Press OK
  10. Save and Close the XLSM file
  11. Re-open the XLSM file and proceed to edit/view the VBA project macros.

For XLS files

  1. Open the XLS file with HexEdit
  2. Search for “DPB=” and replace it with “DPx=”
  3. Save the file
  4. Open the file in Excel, if prompted to “Continue Loading Project”, click Yes. If prompted with errors, keep clicking OK.
  5. Press F11 to open the VBA editor.
  6. Right click on the VBA project, select properties. Open the Protection tab then uncheck “Lock project for viewing”. Press OK
  7. Save and Close the XLS file
  8. Re-open the XLSM file and proceed to edit/view the VBA project macros.

You might also be interested in…

External references

3 Comments

    • Thanks for your comment es. I updated the post adding this possibility of finding a .bin file instead of a .bas.

Leave a Reply

Your email address will not be published. Required fields are marked *