Remove password from Excel VBA project

kuba - Tuesday, 18 September 2018
Share:
Remove password from Excel VBA project

Have you ever been in the situation that you need access VBA project in Excel document but it was locked by password? If yes then you have lucky day. In this article we will explain you how to remove password from Excel VBA project in few simple steps.

First it should be mentioned that we will learn two methods to remove VBA password from MS Excel. One will allow you to access Excel document saved to the older format XLS and the second solution will allow you to remove the password protection from XLSX file.

To remove VBA project password we will need a Hex Editor. You can use for example EF Commander that includes a free hex editor, or you can use Hex Edit.

Open the XLS file with hex editor which you have chosen and search for string DPB. Now you need to replace the DPB to DPx and save the file.

Open the XLS file with Excel and click Yes to any message box that will appear. Set new password from VBA Project Properties. Close and open the file again, and type your new password.

If you like to remove the protection from Workbook you need to open the XLSX file with an achiever like 7-zip. Now browse the folder xl.

If the workbook is protected open it with Notepad and find in the document the portion <workbookProtection workbookPassword="XXXX" lockStructure="1"/> (XXXX is your encrypted password).

Remove XXXX part. (ie. <workbookProtection workbookPassword="" lockStructure="1"/>) and save the file.

When 7-zip will ask you to update the archive, click Yes. Re-open your XLSX file in MS Excel and click Protect Workbook on Review tab. You can also save your Excel to new file.

To remove the password protection from worksheets you need to open the XLSX file with 7-zip and navigate to xl/worksheets/ folder.

You will see there files like Sheet1.xml, Sheet2.xml etc. Edit them with any text editor like Notepad and search for <sheetProtection password="XXXX" sheet="1" objects="1" scenarios="1" /> and remove the line.

When 7-zip will ask you to update the archive, click Yes. Re-open your XLSX file in MS Excel and click Unprotect Sheet on Review tab. You can also save your Excel document to new file.

There are some more friendly solution to remove password from Excel VBA project.

You can use software like Passware Kit or Remove VBA Password.

Both are available for download from our software hub. Links are available below. The demo version of the software don't allow you to recover or remove the password.

It will only check if it can remove it in full version. If you don't like to spend some money on software you still can do it manually with this tutorial.