To unlock it, click on Tools > VBA Project Properties, choose the Protection tab, deselect the "Lock project for viewing" box, and clear the two password fields. To return to the worksheets, close out of the VBE by clicking on the X in the upper right corner, or by pressing Alt+Q.
Save the excel file and exit. Now, open the excel file you need to see the VBA code in. The password for the VBA code will simply be 1234 (as in the example I'm showing here).
Another way to remove VBA project password is;
UPDATE: For Excel 2010 (Works for MS Office Pro Plus 2010 [14.0.6023.1000 64bit]),
If workbook is protected:
xl
workbook.xml
and select Edit
<workbookProtection workbookPassword="XXXX" lockStructure="1"/>
(XXXX
is your encrypted password)XXXX
part. (ie. <workbookProtection workbookPassword="" lockStructure="1"/>
)If worksheets are protected:
xl/worksheets/
folder.Sheet1.xml
, sheet2.xml
, etc and select Edit.<sheetProtection password="XXXX" sheet="1" objects="1" scenarios="1" />
<sheetProtection password="" sheet="1" objects="1" scenarios="1" />
)I found another way to solve this one to avoid password of VBA Project,with out loosing excel password.
use Hex-editor XVI32 for the process
if the file type is XLSM files:
This has a simple method using SendKeys to unprotect the VBA project. This would get you into the project, so you'd have to continue on using SendKeys to figure out a way to remove the password protection: http://www.pcreview.co.uk/forums/thread-989191.php
And here's one that uses a more advanced, somewhat more reliable method for unprotecting. Again, it will only unlock the VB project for you. http://www.ozgrid.com/forum/showthread.php?t=13006&page=2
I haven't tried either method, but this may save you some time if it's what you need to do...
My 2 cents on Excel 2016:
xls
file with Notepad++
DPB=
and replace it with DPx=
error 40230
)I found this here that describes how to set the VBA Project Password. You should be able to modify it to unset the VBA Project Password.
This one does not use SendKeys.
Let me know if this helps! JFV
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With