niedziela, 2 września 2018

remove password from VBA project

  1. Open the XLSM file with 7-Zip (right click -> 7-Zip -> Open archive).
  2. Copy the xl/vbaProject.bas file out of the file (you can drag and drop from 7-Zip), don't close 7-Zip
  3. Open the vbaProject.bas 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.