Skip to content

Instantly share code, notes, and snippets.

@catwhocode
Last active November 22, 2021 15:58
Show Gist options
  • Save catwhocode/f8a8e1544965183a105b6f92bbdc3611 to your computer and use it in GitHub Desktop.
Save catwhocode/f8a8e1544965183a105b6f92bbdc3611 to your computer and use it in GitHub Desktop.
Unprotect VBA on XLSM file

Unprotect VBA on XLSM File

source: https://stackoverflow.com/questions/1026483/is-there-a-way-to-crack-the-password-on-an-excel-vba-project/31005696#31005696

For a .xlsm or .dotm file type you need to do it a slightly different way.

  1. Change the extension of the .xlsm file to .zip.
  2. Open the .zip file (with WinZip or WinRar etc) and go to the xl folder.
  3. Extract the vbaProject.bin file and open it in a Hex Editor (I use HxD, its completely free and lightweight.)
  4. Search for DPB and replace with DPx and save the file.
  5. Replace the old vbaProject.bin file with this new on in the zipped file.
  6. Change the file extension back to .xlsm.
  7. Open workbook skip through the warning messages.
  8. Open up Visual Basic inside Excel.
  9. Go to Tools > VBAProject Properties > Protection Tab.
  10. Put in a new password and save the .xlsm file.
  11. Close and re open and your new password will work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment