VBA stands for Visual Basic for Application, which is a component of MS Office and used by the MS application like Excel, Word, Access, etc. It is a file extension for a visual basic file and contains the visual basic source code. This file is used to add functionality to the MS office application and automates routine tasks especially in Microsoft Excel.

Above, you have read about the description of a VBA file. Now focus here, if you lost your VBA password and you are looking for a manual solution to crack the password. Follow the below steps to recover your VBA password.

Note:

Take a backup of VBA files first.

XLSM files are same as XLSX files but you need to enable the macros to make XLSM files to XLSX.

Method 1: Swap the password using any Hex Editor.

Step 1: Create a new simple excel file (.xls) with the help of Hex editor.

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

Step 3: Save the file and Exit.

Step 4: Now, open the file which you have recently created with a hex editor.

Step 5: Copy the lines starting with the following keys:

CMG=….

DPB=…

GC=...

Step 6: With the help of Hex Editor, open the file in which you want to crack the password and paste the above copied lines from the dummy file.

Step 7: Now, save the excel file and exit.

Step 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:

Step 1: Open a VBA file in any Hex Editor. Search for the text “DPB=”.

Step 2: After that replace the “DPB=” with “DPx=” and Save -> Close file.

Step 3: Now, open the file in Excel and then, press Yes, if the below warning message display:

Step 4: Press Alt + F11 to open the VBA editor and click on OK button, if you will see the following message:

Step 5: Right-click on the VBA project and here, select Properties -> Protection and then, delete the existing passwords. Also, uncheck the checkbox of Lock project for viewing.

Step 6: Now, access the VBA file easily.

Method 3:

Step 1: First, change the extension of the .xlsm file into .zip.

Step 2: With the help of WinZip / WinRar, open the .zip file and then, go to the xl folder.

Step 3: Extract the vbaProject.bin file and open the file in a Hex Editor.

Step 4: Search and replace DPB with DPx and then, save the file.

Step 5: Now, in the Zip file replace the old vbaProject.bin file with this new one.

Step 6: Again, change the file extension from .zip to .xlsm.

Step 7: Open the Visual Basic inside Excel an then. go to Tools -> VBAProject Properties -> Protection Tab. Now, add a new password and save the .xlsm file.

Step 8: Close and re-open your VBA file with new password.

Method 4:

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.

If you’ve followed the above manual steps and still you are not able to access your protected VBA file then try any third party VBA password recovery tool. With the help of such tool, you can easily recover your lost VBA password. This tool enables you to recover any type of VBA files perfectly. Watch the below video and know how this tool recover your lost VBA password.

Follow the below steps to crack the VBA password:

Step 1: Download VBA Password Recovery Tool and run it.

Step 2: Click Open and select VBA file(s).

Step 3: Now, click on File properties.

Step 4: Click on Recover button to recover the password of selected file.