prsnthkrishna
New Member
Hi Can anyone provide me VBA code to unlock password protected files/modules?
There is a whole tread about your question here:
https://chandoo.org/forum/threads/remove-password.23208/
Yes, I can, but no, I won't. If it's locked, it's most likely someone else's intellectual property.Hi Can anyone provide me VBA code to unlock password protected files/modules?
This is my vb code.. I forgot the password.. I need help for unlocking the module..Yes, I can, but no, I won't. If it's locked, it's most likely someone else's intellectual property.
Wouldn't change anything, you didn't invent the wheel, info how to unlock VBA is all over the internet.In any event. if I were to post a solution here, there's no telling where its abuse would end...
If file is xls, i.e. up to Excel 2003. Then use HEX editor directly on the workbook and find "DPB=", replace with "DPx=".
Open the file, go into VBE, ignore or just hit OK when warning comes up. In Tools -> Security, give it a new password. Save the file and close. When you open the file again, you should be able to use the new password to access VBA project.
If Excel 2007 or later (likely xlsm), change file extension to ".zip". Locate binary file in zip for VBA project called "vbaProject.bin". Extract and use HEX editor to do the same as before. Replace the bin file in the zip with edited one. Change extension back to original. Then follow same process as Excel 2003.
You could set hash string in HEX editor, but that can be bit more complicated than above. As you will need to create file with known password. Extract VBA project protection block. And replace the one in unknown password workbook.