How to recover VBA files password?

VBA is a part of MS Office and is used by various MS Office applications like MS Access, Word, and Excel. It contains visual basic source code and is a file extension for a visual basic. This file format is used to add more functionality to MS Office applications and it automates routine tasks especially in Excel. Oftentimes a user may lose or forget his VBA file password. So, in this blog we are going to discuss 4 methods to recover the VBA file password. 

It is recommended that you should take a complete backup of VBA files before implementing the methods to recover the password. The XLSM files are similar to XLSX files but you should enable the macros to make .xlsm files as .xlsx.

4 method to recover VBA file password-

There are several methods by which you can recover the password of a VBA file. In this blog we have discussed only a few methods to recover the password. 

Method 1: Using Hex Editor to Swap the password 

1- First you have to create a new simple excel file (.xls) by using Hex editor.

2- Now, set a desired password in the VBA section (Alt + F11).

3- Save the file and then click on Exit.

4- Open the file which you have recently created with a hex editor.

5- Copy these lines starting with the following keys:

CMG=….

DPB=…

GC=…

6-  Now use the Hex Editor to open the file in which you want to recover the password and paste the above copied lines from the dummy file.

7- Now, save the excel file and click on “Exit”.

8- Open an excel file where you need to see the VBA code and here, use the same password, which you’ve used for a dummy VBA file in step 2.

Method 2: Using Winzip/Winrar to recover password of VBA files

  1. First you have to change the file extension of .xlsm into .zip
  2. Now with the help WinZip / WinRar, start the ZIP file and then, select the .xl folder.
  3. Now, you extract the vbaProject.bin file and, then open that file in Hex Editor
  4. Search and replace the DPB with DPx and save that particular file
  5. Under the Zip file, you can replace the previous vbaProject.bin file with this latest one
  6. Again, you have to change the file extension from ZIP to XLSM file
  7. Start the Visual Basic in MS Excel, choose Tools and VBAProject Properties. Then, select Protection Tab and now, you can add a new password and save .xlsm file
  8. Close and re-open the VBA file with a new password.

Method 3:  Using VBA Editor

Step 1: First, open the workbook in which the protected sheet consists.

Step 2: Press Alt+F11 to view or open the Visual Basic Editor. Now, enter the Insert-Module and paste the below code into the right-hand code window:

Step 3: Then, close the VB Editor window and navigate to the worksheet you want to unprotect.

Step 4: Enter Tools-Macro-Macros and double-click on PasswordBreaker in the list.

Method 4: Using VBA password recovery tool

Professional Way to recover VBA file password-

If you failed to recover the password by above methods and still you are not able to access your protected VBA file then you should go with the professional method i.e, VBA password recovery tool. 

The manual method consumes a lot of time and effort, any wrong step may lead to data loss or VBA file corruption. So, in order to save the time, effort, and prevent data loss you should use the professional method i.e, VBA password recovery tool. With the VBA password recovery tool you can easily recover the password of your VBA files in just a few clicks. The tool is 100% secure, easy to use, and recovers the password without any data loss and without any extra effort. 

Leave a comment