Removing the password from a VBA project

后端 未结 6 1776
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 17:08

How can I programmatically remove a (known) password from an Excel VBA project?

To be clear: I want to remove the password from the VBA Project, not the workbook or

6条回答
  •  爱一瞬间的悲伤
    2020-11-30 17:26

    Another way to remove VBA project password is;

    • Open xls file with a hex editor. (ie. Hex Edit http://www.hexedit.com/)
    • Search for DPB
    • Replace DPB to DPx
    • Save file.
    • Open file in Excel.
    • Click "Yes" if you get any message box.
    • Set new password from VBA Project Properties.
    • Close and open again file, then type your new password to unprotect.

    UPDATE: For Excel 2010 (Works for MS Office Pro Plus 2010 [14.0.6023.1000 64bit]),

    • Open the XLSX file with 7zip

    If workbook is protected:

    • Browse the folder xl
    • If the workbook is protected, right click workbook.xml and select Edit
    • Find the portion (XXXX is your encrypted password)
    • Remove XXXX part. (ie. )
    • Save the file.
    • When 7zip asks you to update the archive, say Yes.
    • Close 7zip and re-open your XLSX.
    • Click Protect Workbook on Review tab.
    • Optional: Save your file.

    If worksheets are protected:

    • Browse to xl/worksheets/ folder.
    • Right click the Sheet1.xml, sheet2.xml, etc and select Edit.
    • Find the portion
    • Remove the encrypted password (ie. )
    • Save the file.
    • When 7zip asks you to update the archive, say Yes.
    • Close 7zip and re-open your XLSX.
    • Click Unprotect Sheet on Review tab.
    • Optional: Save your file.

提交回复
热议问题