Unlock your password protected VBA Projects

Recent Articles

A few days ago, I was trying to unlock my VBA macro for which I had forgotten the password. The password was completely out of my mind and unlocking the macro was important as i could not write the 19 modules again :). So i found this way to unlock the VBA password on http://datapigtechnologies.com/. So i thought to share it here so that someone troubled could take help.


Warning : Please do not use this procedure to unlock someone else's code/ copyright material. It can be an offence and you may be under trouble in that case. The article is for education purposes only and is for ethical hacking only.



I'm notoriously lazy, so there is no way I'm retyping code that's already there. I'd rather hack into the workbook.


Today, I'll walk you through the steps I use to crack VBA passwords. I learned this trick a while back from one of my Excel Boot Camp students. I can't remember who. Sorry…whoever you are. Even though I can't remember your name, I value our friendship greatly.


Step 1: Download a Hex Editor


You'll need a Hex Editor. I use one called XVI32. Why this one? Because it's the one my mysterious friend showed me. I'm not really into Hex Editors, so I couldn't tell you if it's good or bad. I just know it does the trick. Download the XVI32 Hex Editor and have it ready to go.


Step 2: Save your Workbook as XLS and MAKE A BACKUP COPY

If you're working with an XLSM file, you'll need to save it as an XLS. Be sure you make a backup of your workbook before you start. Because you're diddling the insides of the workbook, there is always a chance you could royally screw up. You'll want a backup.


Step 3: Open Your Workbook in the Hex Editor

Fire up the Hex Editor you downloaded and then (within the editor) select and open your workbook. In the XVI32 editor, my workbook looks like this:




Step 4: Find and Replace the DPB Keyword

In your Hex Editor, look for the text string DPB.




This text string apparently indicates Excel's tag for the VBA Password.




In order to confuse Excel and get around the VBA Password prompt, you just need to muddle the tag a little. You can do this by simply changing the DPB to something like DPX (replace the B with an X).




Step 5: Save Your Changes

Close the Hex Editor and be sure to save your changes




Step 6: Open your Newly Diddled Workbook

Open the workbook you just finished molesting. You will get a few messages. v1

First this one, which you will say Yes to:



Then you'll see this one (a few times). Don't panic, and keep clicking OK.




Step 7: Remove the VBA Protection

When Excel stops its bitching and moaning, go to the Visual Basic Editor (Alt+F11) and then select View>>Project Explorer.

Right click on the VBAProject for your workbook and select VBAProject Properties.




In the Properties dialog box, go to the Protection tab and clear any selections and text you see there.




Step 8: Save a Close your Newly Unprotected Workbook.

Save and close the workbook. At this point, you'll have full reign over the VBA in the workbook.


There you have it – another trick for your toolkit.

I could suggest that you use this trick only for good and righteous purposes, but you won't listen anyway.

From Overweight, Alcoholic And Smoker To Marathon Man...

Another inspirational & motivational story from the field of sports. Let's meet Runner "Steve Way" who become a role model for many people's around...

Health Benefits of Jackfruit | 12 Amazing...

Jackfruit is an Asian tropical fruit that belongs to the family of Moraceae, which is normally found in tropical areas like Thailand, Malaysia, India,...

Brilliant Animation of Olympic Champions Michael Phelps, Usain...

A German artist "Felix Deimann" has recreated the movement of Olympic artists in a series of surreal animations designed to show exactly how they...

Splitsvilla 7 – Episode 14 – Pic A...

Watch the full 14th episode of SplisVilla 7...  Who is the stinkiest boy on Splitsvilla? Find out in the 14th episode of Killer MTV Splitsvilla https://www.youtube.com/watch?v=Qv6Mbw1l-z4

15 Rare & Old Photo’s of Las Vegas...

Las Vegas was founded as a city in 1905, when 110 acres (45 ha) of land adjacent to the Union Pacific Railroad tracks were...

4 Myths and Reality Of Latest Israel-Hamas Conflict...

Don’t believe everything you read — especially as it relates to Israel.As Israel’s latest war with the Palestinian terror group Hamas continues with no...