Change/Remove the Password of a Password-Protected VBA Project in Microsoft Excel
Some Excel VBA developers are protecting their codes and modules with password in order not to let others view the content of their project....
http://msexcel-tutorials.blogspot.com/2014/01/changeremove-password-of-password_13.html
Some Excel VBA developers are protecting their codes and modules with password in order not to let others view the content of their project. It's okay to open these files if you really knew the purpose of the project. But, what if you're in a company having bundles of confidential information that you're not allowed to divulge to any other parties and the Macro runs Malicious Codes to obtain such information. Or in worst cases, can also be used to spread viruses over the network you're connected with.
One day, you might have received an email from a friend with an excel file attachment containing macros in it. And you are told to open it because He/She has a data that needs to show to you. And when you open it, suddenly you're system got compromised.
So if you have the basic understanding with the programming language (VBA), then you might want to know what are the codes and applications are running when you open the excel file. But that doesn't end there!
When you try to open and view the VBA Project it prompts you to input a password in which you don't have an idea unless if He/She gave it to you. And if you're good at guessing then guess the PASSWORD!
We'll, I guess that's not a good idea. But the good news, is that you can set the VBA Project's Password to a password of your own.
Changing/Removing the Password:
So what do you need?
1.) You need to create a new Excel File with a known VBA Project Password.
a. Open Microsoft Excel, Press Alt+F11 to open the Microsoft Visual Basic window.
b. Set the VBA Project Password to '1234'. See How to Set Password on Excel VBA Project.
c. Save the file as "password.xls" on your desktop or to location you can easily access.
d. Close the file.
2.) You will need any HEX Editor. You can download a free and portable HEX Editor here.
a. After Downloading, extract the compressed package and open the on the output folder.
b. Browse the Excel File that you want to change/remove the password and the Excel file you've just created with a known password.
c. Drag and Drop the files on the HEX Editor's Window. As you can see below.
d. Now on the HEX Editor's Window, Select the password.xls tab.
e. Press Ctrl+F, type "cmg" without the "" then press enter. CMG will now be highlighted.
f. Now, Select CMG and DPB values as you can see below and Press Ctrl+C to copy.
g. Next, select the PasswordProtectedVBAProject.xls tab and repeat steps e & f.
h. Now that you've selected the CMG and DPB values of the Password Protect VBA Project. Press Ctrl+V to paste the ANSI data from the password.xls file.
i. Save the PasswordProtectedVBAProject.xls and close the HEX Editor Window.
You can finally open the VBA Project!
When you open the Password-Protected VBA Project, you'll now be able to open and view the modules and codes using the password '1234'.
And then you found out that the macro is only saying "HELLO WORLD!" =:)
One day, you might have received an email from a friend with an excel file attachment containing macros in it. And you are told to open it because He/She has a data that needs to show to you. And when you open it, suddenly you're system got compromised.
So if you have the basic understanding with the programming language (VBA), then you might want to know what are the codes and applications are running when you open the excel file. But that doesn't end there!
When you try to open and view the VBA Project it prompts you to input a password in which you don't have an idea unless if He/She gave it to you. And if you're good at guessing then guess the PASSWORD!
We'll, I guess that's not a good idea. But the good news, is that you can set the VBA Project's Password to a password of your own.
Changing/Removing the Password:
So what do you need?
1.) You need to create a new Excel File with a known VBA Project Password.
a. Open Microsoft Excel, Press Alt+F11 to open the Microsoft Visual Basic window.
b. Set the VBA Project Password to '1234'. See How to Set Password on Excel VBA Project.
c. Save the file as "password.xls" on your desktop or to location you can easily access.
d. Close the file.
2.) You will need any HEX Editor. You can download a free and portable HEX Editor here.
a. After Downloading, extract the compressed package and open the on the output folder.
b. Browse the Excel File that you want to change/remove the password and the Excel file you've just created with a known password.
c. Drag and Drop the files on the HEX Editor's Window. As you can see below.
e. Press Ctrl+F, type "cmg" without the "" then press enter. CMG will now be highlighted.
f. Now, Select CMG and DPB values as you can see below and Press Ctrl+C to copy.
g. Next, select the PasswordProtectedVBAProject.xls tab and repeat steps e & f.
h. Now that you've selected the CMG and DPB values of the Password Protect VBA Project. Press Ctrl+V to paste the ANSI data from the password.xls file.
i. Save the PasswordProtectedVBAProject.xls and close the HEX Editor Window.
You can finally open the VBA Project!
When you open the Password-Protected VBA Project, you'll now be able to open and view the modules and codes using the password '1234'.
And then you found out that the macro is only saying "HELLO WORLD!" =:)