Document

The Complete Guide to Cracking Excel VBA Password

Is it possible to break into my Excel VBA project if the code is protected with a lost or forgotten password? And if so, how can this be done? The answer is yes. Cracking an Excel VBA password is not a difficult task if you have the right tools. In fact, once you have the right tool and methodology in place, it can be quite easy to crack even complicated passwords.

In this article, we will show you how to hack VBA passwords by using a few simple methods. But first let’s take a look at what VBA password is in Excel.

VBA Password—How Does It Work?

VBA (Visual Basic for Applications) is a programming language used to make Microsoft Office applications such as Excel and Access more powerful and easier to use. VBA is also used to create custom applications.

A VBA project can be protected with a password to prevent unauthorized access. When you open a VBA project in Excel spreadsheet, you may be prompted to enter the password (as the image shown below). If you do not enter the correct password, you will not be able to view or edit the VBA code.

Need to Supply Password to View VBA Code

How to Crack an Excel VBA Password

There are a few different methods that can be used to crack an Excel VBA password. We will look at each of these methods in detail below.

Method 1: Using VBA Password Reset a

“VBA Password Reset a” is a powerful Excel password recovery plugin that can quickly reset the password to “a” from most VBA projects. This tool is compatible with Excel 2007 and above on a Windows computer, as well as Excel 2016 and higher on a Mac.

The Excel VBA Password Reset a add-in, once installed and enabled, will be accessible from the Excel ribbon. It takes only two actions to remove a macro password in Excel.

Step 1. Open workbook file with password prompt—click on “Reset VBA password – a”.

Enable Reset VBA password – a in Excel

Step 2. Select an option to reset the password—here we may select “Unprotect all sheets in active workbook” from the menu.

Select Unprotect all sheets in active workbook in VBA Password Reset a

You will be given a copy of your Excel file at the same location as where it was originally created and with an “a” VBA password.

Method 2: Using SysTools VBA Password Remover

SysTools introduced a Windows application called “SysTools VBA Password Remover” for Excel 97 and later versions. This program will crack VBA passwords in Excel workbooks easily without any technical knowledge required.

Step 1. Click the button below and download this program.

Free Download

Step 2. After you’ve launched the program, you’ll see a page with the heading “Check for Prerequisites”, where we need to click “OK” in order continue.

SysTools VBA Password Remover Check for Prerequisites Page

Step 3. Select the Excel workbook with encrypted content using the “Add File(s)” button. Then click “Reset” in order to unlock all its VBA codes.

Add VBA Password Protected File to SysTools VBA Password Remover

Step 4. Now you can see that a new password has been set for this file and the status says “Pass”, which means this will be the password for accessing your VBA project.

VBA Password Has Been Reset with SysTools VBA Password Remover

Method 3: Change Extension + Hex Editor

In order to reset or remove a password from an Excel workbook using Hex Editor, we first need to back up the file that has been protected by VBA password. After you have backed up the file, follow these steps:

Step 1. Change the Excel file extension from “xlsm” to “zip”. This will make the file appear to be a ZIP archive.

Change Excel VBA File Extension from XLSM to ZIP

For many people, the “Hide extensions for known file types” box in Folder Options is checked by default. Unchecking this box will make extensions visible in File Explorer.

Uncheck Hide Extensions for Known File Types in Windows Folder Options

Step 2. Extract the ZIP file with a tool like WinZip or 7-Zip.

Step 3. Open up the unzipped folder. Inside of this one there is an “xl” subfolder where you can find the “vbaProject.bin” file.

Find vbaProject.bin File in xl Folder

Step 4. Open the “vbaProject.bin” file with a hex editor such as HxD.

Step 5. Look for “DPB” within the file.

Open vbaProject.bin and Search for DPB in HxD Hex Editor

Step 6. Now change “DPB” to “DPx”. Save the changes and exit.

Only “B” should be changed to “x”, and don’t eliminate the equal sign by mistake.

Change DPB to DPx with HxD Hex Editor

Step 7. Compress all the folders and files to a ZIP.

Compress the Modified XLSM Folders and Files to a ZIP File

Step 8. Change the extension from “zip” to “xlsm”, and then opening it.

Change Extension from ZIP to XLSM

Step 9. Okay, so you’re in the xlsm file. The first thing that may happen is a lot of errors popping up but don’t worry: just press “Yes” to dismiss them.

Open the VB editor by clicking “Developer” then “Visual Basic”. Then, under “Tools” > “VBAProject Properties”, remove the check for “Lock project for viewing”.

Uncheck "Lock project for viewing" for Viewing the Cracked VBA Code

Step 10. Close the editor and save the Excel file. It’s possible that it’ll notify you to save in a different location as a new file.

Step 11. Open the new file. Your VBA code will now be visible without the need to enter a password!

*We have tested this method on an Excel 2007 file.

Conclusion

VBA Password has been used by many developers in order to protect their code from being seen or edited by other people who will misuse it. This is a good technique in most cases, but when you forget your Excel VBA password and need to see your project code, the above methods will help you.

In this article we’ve covered three ways you can gain access to your VBA project without the need of a password. Whether you want to use an add-in tool or download a password remover program from SysTools, it doesn’t take long before your file is open and available for editing again.

Susanna

Susanna is the content manager and writer of Filelem. She has been an experienced editor and book layout designer for many years, and interested in trying and testing various productivity software. She is also a huge fan of Kindle, who has been using Kindle Touch for nearly 7 years and carrying Kindle almost wherever she goes. Not long ago the device was at the end of its life so Susanna happily bought a Kindle Oasis.

Related Articles

Back to top button