How to bypass the VBA project password from Excel

I need help with password retrieval or bypassing the password on a project that was done at work. The author has used MS Excel to do the project, and it's in the client's server. The server that we use has no access to Notepad++.


For older .XLS files:

  1. Open file in any hex editor

  2. Search for the text "DPB=" (no quotes, you should find it just above "[Host Extender Info]"

    1

  3. Change it to "DPx=", save and close the file

    2

  4. Open the file in Excel and press Yes if the following warning pops up:

    3

  5. Open the VBA editor (Alt+F11) and press OK whenever the following warning pops up:

    4

  6. Right-click the VBA project name, select Properties, go to the Protection tab and delete the existing passwords as well as uncheck the Lock project for viewing checkbox:

    5

  7. Re-check the Lock project for viewing checkbox and add your own memorable password.

  8. OK your way out and now the VBA code is accessible!

For newer .XLSM files:

  1. Change the file's extension to .ZIP

  2. Open the file in any archiver such as WinRAR or 7-Zip and you'll see the following directory structure:

    6

  3. Go into the xl directory and extract vbaProject.bin:

    7

  4. Perform steps #1-3 above (from the For older .XLS files section) with vbaProject.bin

  5. Replace the old vbaProject.bin in the ZIP file with the new hex edited version

  6. Change the file's extension back to .XLSM

  7. Perform steps #4-7 above