Removing an Excel VBA password – using a Hex editor
A VBA project password can be removed with a hex editor (I used the XVI32 Freeware editor from here). Although I didn’t discover this method, I’m happy to post the process with screenshots to help others. Sometimes all we need is that little snippet of code in an old VBA project we’ve archived away…
Open your chosen workbook file (.xls or .xla file) in the hex editor. It will look like the following;
Now search for the Text string “DPB” and change it to “DPx” (simply type over the value).
Save the file over the top of the existing workbook and close.
Now, open the workbook in Excel and click OK until the workbook is open (you may receive a couple of VBA errors on the way). Press ALT+F11 to open the Visual Basic Project window, From the Tools menu, choose the command VBAProject Properties, navigate to the Protection tab, and change the password but do not remove it (note the new password).
Save the workbook, close, and re-open.
Once open, press ALT+F11 and enter the new password.
Finally, choose Tools -> VBAProject Properties, navigate to the Protection tab, and remove the password.
Save the workbook.





@Paulo
Simple work arround – Save the file in .XLS format, change passwod, save it back as .XLSM
@ Amit : I have a .xlsm file for which I am not able to remove the password. Earlier I did this by converting it to .xls and then using Hex Editor.
Can anyone please help me.?
please send your email ID it dont works i want to send the file
Guys, I’m really sorry your comments haven’t been appearing – it seems my host hadn’t enabled cURL, so my Akismet (spam checker) wasn’t running…I had 1000 comments to wade through!
Thanks for all your feedback.
It seems the most common problem is that the DPB entry is missing when xls files are opened in the Hex editor – to fix this, just make sure you save your sheet as an .xls file (Excel 97-2003 version) and it will be ok.
Let me know if you have exceptions to the rule…!
Dave.
I’m working on a Mac with Excel 2011. Saving the file back to Excel 97-2003 version allows Hex editing to alter the DPB entry to DPx.
On reopening the file, Excel raises a recovery error. It dumps out a repair result file with “Lost Visual Basic project”. The VBA files are dumped.
Any suggestions?
@admin
Im having big trouble trying to remember the password of an excel file (damn you Diet Coke!), and my file is in xlsx format.
Dont understand how to save my sheet in xls format if I can´t open the file….Im confuse here
Desperate Jerry
Hi Jerry, unfortunately this method can’t be used to unlock spreadsheets with file-open passwords. It’s only good for VBA project passwords… Sorry!
@admin
Dave
I´m pretty sure that my file does not have any lock spreadsheets, only has a file-open password…which I don´t remember.
It’s possible to send you the file so you take a look of it?
nice and clear!
Tested ok on an VBProject under Excel2003.
Thanks for this post
Hey this works great
thanks a ton man
This worked great thanks!
Is this “trick” also working with xls 2007 – I have the feeling it is not?
sir…help me please…this software(Hex Editor) can’t find DPB on file type excel macros….how about solution…I try to find DPB an replace into DPx, but nothing found….I think this software doesn’t work on Excel macros 2007 above
Please try saving the file in 2003 version – the DPB item in the Hex editor may not show unless you do so.
Dave.
does this method work for excel 2010? the file once converted to 2003 does not have the vba project anymore.
Really nice
It works perfectly for VBAProject password in .MDB Access 2003.
Thank You Very Much
Dear Sir
I used this tool to recover my vba password in this procedure >>
I searched DPB
I replaced with DPx
when I reopened the worksheet >>> it was still protected …
may I done errors ….
I ‘d be grateful if U mentioned …
Thank U
That was really simple yet efficient!!!
Great job.
Worked like a “Champ” on Excel 2010! Much appreciated and many thanks.
Great advice. Problem solved on my Excel 2010. Thks pal!
Now I worry that my VBA password is so easily compromised.
Hi.,
Using this tip, I could unprotect the vba forms and modules. but when i try to open the code, I m getting ‘unexpected error 40230′.. Can anyone of you please help me?
I have a .xlam file that I don’t know how to save as a .xls file. In the VBA editor it is asking for the password to open the project so I can’t do anything with it. Is there a way to save this to a different file format?
Thanks,
I cant find a DP string in my document but i do have the VB code pw protected and I cannot remember my own pw! is there an option to DPB? why would i not be able to find this in my file?
thanks!
Michele
i take the prev comment back – i saved in 2003 and excellent fix!!
This method worked in an older version of an XLA add-in, but not in a more recent version. Any suggestions? Thank you
Sorry – to be clear, the DPB text string does not exist in this newer version but it is password protected.
Thank you so much for sharing this info. Was able to remove VBA project password from a XLA add in within a 2007 file quickly and easily.
I run this tool, replaced the DPB with DPX, when open the excel VB editor, it shows error # 40230.
Please advise
Great job
this method work for excel 2010, perfect
Thank U
Great write up! Easy to follow and works just as explained. This just saved me from buying a password remover.
Thanks
thanks alot it helped me to crack the password
Just curious to know if this applies to powerpoint vba as well. If not, then is there a similar way out to remove password for ppt vba
This really helped with a excel 2010 vba that i had protected and forgot the password 6 months ago, just changed saved the file under a different name as 97-2003 file, opened the new file and changed the DPB to DPx, reopened the file after saving in excel 2010, ignored the warnings and continued, saved the opened file as another file and hey presto had a non vba protected VBA excel file!
Thanks a ton saved me rewritting a complex Macro that took at least a week to debug!.
I cant find “dbp”. Any suggestions?
@goo
it works!
hallo,,i will pay for someone who can crack my excel sheet..i received a database with protected password..is there anyway to crack into this excel sheet ???? pls , i need serious someone who can hack into this for me…pls reply with a email
Hi
This trick is awesome. It worked for me. Thanks a lot for posting this.
@pieter
if you mean cracking password of the sheet protection, it’s me can help,
but if for the file crack, I am developing… not now.
you can contact me pichartyapan@gmail.com
Hi friend,
I really appreciate your skill. I was followed the steps and successful to remove the password.
One more thing if you have any idea about removes the ms – access project explorer password so please inform me.
Many Many thanks……..
@admin
@admin
@Jerry
i can open the file for you. email me at charlie.d.castillo@gmail.com
@pieter
i can open any lock sheets or workbook. email me @ charlie.d.castillo@gmail.com
ss
this isnt working for me, i have a XLS file i open it in a simple hex editor change the DPB to DPx re save and open in excel and it says that the macro is currped and will be deleted and just deletes the workbook and replaces it with a new one, looseing all the data, PLEASE HELP
desperately needed data, im re opening the doc in office 07 does this matter?
thanks