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.
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”.
Step 2. Select an option to reset the password—here we may select “Unprotect all sheets in active workbook” from the menu.
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.
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.
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.
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.
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.
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.
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.
Step 4. Open the “vbaProject.bin” file with a hex editor such as HxD.
Step 5. Look for “DPB” within the file.
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.
Step 7. Compress all the folders and files to a ZIP.
Step 8. Change the extension from “zip” to “xlsm”, and then opening it.
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”.
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.
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.