Monday, 24 March 2014

Excel removing password from: VBA Project, Workbook, Sheet.

Updated to ver 1.2 (corrected issue with finding 'VBA Project.bin' file when Windows option "hide extensions for known file types" switched on.
--------------------------------------

Excel uses several others types of protection, the most common: WorkSheet and WorkBook protection, also not real one but more for foolproof. Regarding this topic there are much more info than about VBA Project unlocking, yet I decided to combine all those feature within one simple tool - 'Excel Unlocker.xlsm'.

Features:
  • Unlock VBA Project
  • Remove WorkBook Protection
  • Remove WorkSheets Protection
Unlock VBA Project. Uses the same algorithm described on previous post.

Remove WorkSheets Protection.
Macros just extracts all Sheets into tmp folder, then removes parameter "sheetProtection" from sheet xml files, and put them back into archive. (Remember, starting from version 2007 Excel stores its file in ZIP compressed archive with a directory structure of XML text documents, meaning that if you change extension from xlsx to zip you'll get a zip archive).

Remove WorkBook Protection. 
The program tries to find acceptable password, taking into account the fact that Excel uses algorithm which convert any password into 16-bit HASH and store it within the file (first bit always the same, so 2^15=32768 possible values, it's quite easy to try them all). Why that tactic? Certainly, there is an option to remove WorkBook protection parameter in workbook.xml file (inside zip archive), but 2007 version uses AES-128 encryption for files which have WorkBook protection option (meaning that even if you do not use your own password (leave it blank) when switch on WorkBook protection option Excel uses 'VelvetSweatshop' password for encrypting your file). So, you can't access inside excel file structure that easy, but checking 32768 values takes from few second to several minutes (on old PCs).

Yet in Excel 2013 Microsoft used another trick - changed tactic of calculation password HASH from 50 000 rounds of AES-128 to 100 000 rounds of AES-512, that significantly increased calculation time (from a 5-15 sec to 6 hours on AMD 4-cores 3,2 Ghz). Originally this tool was developed for 2007 Excel, and not took into account changes in 2013 version.

Please consider, that for some files method to unlock VBA Project may not work (because method build on 'known trick' rather than understanding technology behind).

74 comments:

  1. Thank you for this! Finally something that works and we don't have to pay 30+ usd... Thanks a lot again

    ReplyDelete
  2. Thanks for posting this. I am using Excel unlocker to remove VBAProject password but it says
    "file don't have Vba Project". But when open the file I can see Vba Project and its password protected. Please help on this...

    ReplyDelete
    Replies
    1. If you send me your file I can have a look at it.

      Delete
    2. hi i send the file which u need to remove the password,
      plz do the need full

      Delete
    3. Problem was with the references in locked file, now file wokrs fine.

      Delete
    4. Hi, I have the same problem as above. It says "file don't have Vba Project".
      What should I do to fix that?!

      Thanks!

      Delete
    5. I've send my file to Pankaj, please see below.

      Delete
  3. Hi Anton,

    I tried to run "unlock vba project". It resulted in Unprotected_.xlsm. I was unable to unlock the vba of this file using the password "macro". Any idea how to resolve this?

    ReplyDelete
  4. Seem as meer abouve : Thanks for posting this. I am using Excel unlocker to remove VBAProject password but it says
    "file don't have Vba Project". But when open the file I can see Vba Project and its password protected. Please help on this...

    Any solution you found for this?
    omazone@gmail.com

    ReplyDelete
  5. If you send me the file that you are trying unprotect I can have a look.

    ReplyDelete
  6. I have the same problem. When trying to use your tool to unprotect the vba project, it ran successfully with no errors, but when opening the newly named unprotected file, and trying to use the password macro, it is the wrong password and so file is still protected. Do you have a common solution to this problem you could share? Many thanks

    ReplyDelete
    Replies
    1. I've tested this tool only for those file that was in my possession. Certainly, there might be files with inner structure that not forseen in macro or such on which described unlocking method simply doesn't work. But to be shure I have to have file with issue to do investigation.

      At the moment, no one, who reported such issue sent me the file, so I can't have common solution for problem that never been solved.

      My e-mail: lbeliarl@gmail.com, send me your file and I can have a look what's wrong.

      Delete
  7. Hi Anton, I hv sent you a mail with the attachment.. Please check and reply. Thanks in advance!

    ReplyDelete
    Replies
    1. Hi, unlocked without any problem... maybe it has something to do with PC environment, Excel assembly, etc.

      Delete
    2. Hey i have sent a mail with attachment...plz crack it.

      Delete
  8. Hello. I am not able to download it on my note 3. Link redirects me to google drivr then lands me down to ms office mobile version. Then an emply worksheet appears with a cell highlighted in yellow color. Please send me the tool on dembla.m.k@gmail.com

    ReplyDelete
  9. Hi Anton!

    I tried to use your file but it can removed only sheet password, but it still can't remove VBA password. so how can I do?

    ReplyDelete
  10. i sent you a mail please check it and help me

    ReplyDelete
  11. please help me with this excel file i am unable to remove password from it please help me with this

    ReplyDelete
    Replies
    1. Password for workbook open cannot be removed, its content encrypted by proper ciphering (suppose RSA-128)

      Delete
  12. can i crack a vba project password in a file .xla ????
    i need to change some macros and who create it did not leave the pass .....

    ReplyDelete
    Replies
    1. I think so, but not with this tool. You can try manual way described in previous post.

      Delete
  13. Hello Anton!

    I have a compile error with the message: "The code of this project must be updated for use on 64-bit systems Analyze and update Declare statements and then mark them as attribute PtrSafe."
    Can you solve this, please?

    ReplyDelete
    Replies
    1. Hello Pedro.

      This problem related to compatibility of VBA in different version (x32/x64) of MS Office (don't confuse it with Windows digit capacity. By default x32 version of Office installs on either x32 or x64 version of Windows). Some code created for x32 Office should be adapted to run in x64 Office environment, unfurtunatly this tool have such code.

      Delete
    2. Ok, I understood the difference.
      The file "VBA_Project_Unlocker" runs well but can not remove the password from my VBA.
      The error is in the file "Excel Unlocker", on line 5 "Declare Function GetTickCount Lib "kernel32.dll" () As Long".
      What should I change to run in x64 Office environment?

      Delete
    3. I see, this library used only for calculating ETA (estimated time of arrival). I've commented the library, try updated file here: https://drive.google.com/file/d/0B6sFi5sSqEKbcTBaeVg3eTFId28/view?usp=sharing

      Delete
    4. Now the file has run! But did not remove the password .. I write "macro" and excel says that the password is invalid.

      Delete
    5. There is two possible solutions: either tool works not correctly in x64 office environment or password cannot be removed from your file by this method. Try to run tool in x32 environment.

      Delete
    6. When i tried to debug the VBA code found that when using Office 2013 x64, the file name was read as "vbaProject" instead of "vbaProject.bin". Changing this in the two place where the comparison is done, it works beautifully.

      Delete
    7. It's not due Office x64 but because of "hide extensions for known file types" option in Windows for folder settings. Now problem corrected in version 1.2.

      Delete
    8. Thanks for your application, i try to learn because i not familiar scripting, But, with your aplication i can remove *.x l s b prote-cted file :)

      Delete
  14. help
    https://drive.google.com/file/d/0BytHgMviw1IlZ2hwNGNzY2JqaFU/view?usp=sharing

    ReplyDelete
  15. I keep getting this error

    If SH.ProtectContents Or SH.ProtectDrawingObjects Or SH.ProtectScenarios Then

    ReplyDelete
  16. Hi,
    Would it be possible to make 'Excel Unlocker.xlsm' to unlock xlsx files with protected shared worksheets?
    If so, how is this done the easiest way?
    BR Bjarne

    ReplyDelete
    Replies
    1. The tool already can remove WorkSheet protection, but first you should 'unshare' workbook (macro requires exclusive access to the file).

      Delete
  17. Can someone send me the file on rocki_thegreat@yahoo.com

    ReplyDelete
    Replies
    1. Have you had any success with the file I send you?

      Delete
  18. This comment has been removed by the author.

    ReplyDelete
  19. Thanks Anton. This worked on an Excel 2007 file running on 64bit Win 8.1 with Office 2013. However, when I selected my file and clicked OK, your program created a new file with the word "Unlocked" preceding the file name. My original file remained unchanged. It was the new file that had the VBA password changed to "macro".

    ReplyDelete
  20. Hi Anton

    Firstly, thank you very much for Excel Unlocker. I am having a similar issue to previous comments where Excel Unlocker returns "file don't have Vba Project". However there is definitely a Vba within it that I created a number of years ago and it is password protected. Please can you help me on this. Thank you in advance.

    ReplyDelete
    Replies
    1. Hi, now tihs issue is fixed, new version (1.2) released.

      Delete
    2. Wow, thank you so much Anton!

      Delete
  21. Is it possible to unprotect a password protected workbook? The VBAProject is also password protected.

    ReplyDelete
  22. hi could you help me, when i want to select data i got error message
    "Unexpected error (32809)"

    i'm using win7pro 64bit & office home & business 2010

    thank you

    ReplyDelete
  23. I am Korean.
    Do not speak English.
    Do not remove the password at all.

    Please tell us your email
    I'll send the file


    Using Google Translator

    ReplyDelete
  24. http://vbnvba.tistory.com/325

    Please check the attached file


    Google Translate

    ReplyDelete
  25. Hi, thanks a lot, really useful if you forgot your passwords. So I've unlocked my file and its in uncompressed zip that opens into many sub folders in windows explorer. How do I get it back into an excel file?

    ReplyDelete
    Replies
    1. Just change the extension back to original '.xlsm'

      Delete
  26. Hi Anton

    Can you please help me with this file. I dont know how to use unlocker.

    Plz help. Thanks a lot

    https://docs.google.com/spreadsheets/d/118fr8KSm2vZZk8dvjeitgPISQ6_IPQm-Hp5rMJU4XMo/edit?usp=sharing

    ReplyDelete
  27. Hi, used this great tool but once the .zip it's created it's locked and cannot open. any clue?

    ReplyDelete
  28. how open the file with workbook encrypted? "Selected workbook is encrypted (Password for Opening)!"

    ReplyDelete
  29. Knowing when to hire a plumber is vital to maintaining your home. Many homeowners attempt to make repairs to appliances, fix broken pipes, or unclog a sink, only to find out they have made the problem worse .
    62 |

    82 |

    117 |

    142 |

    169 |

    171 |

    203 |

    219 |

    235 |

    274 |

    ReplyDelete
  30. where can i get the version 1.2?

    ReplyDelete
  31. Anton, simply put, you're a GEM.... thanks heaps

    ReplyDelete
  32. Hai... I got error while using the tool

    "Unexpected error (32809)"

    ReplyDelete
  33. This comment has been removed by the author.

    ReplyDelete
  34. Download MS Excel unlocker to know how to unlock MS Excel file password and recover MS Excel password with xls, xlsx, xltm, xla, xlm, xlam, xlsm and xlsb
    Read More: http://www.excelpasswordremover.com/

    ReplyDelete
  35. With the help of MS Excel password unlocker program all users can remove MS Excel file password and recover Excel file password with all Excel versions and able to open password from xls, xlsx, xlsm, xltm, xla, xlam, xlsb files.

    read more

    http://www.microsoft.excelunlockertool.com/

    ReplyDelete
  36. Get this best solution of MS Excel password breaker to break and recover Excel password with all versions Excel file including xlsx, xls, xlsb, xla, xlam, xltm and xlsm

    read more

    http://www.excelpasswordrecoverysoftware.excelpasswordremover.com/

    ReplyDelete
  37. Very very good program! thanks in advance!

    ReplyDelete
  38. Hi Anton,

    Do you have a guide to remove VBA password without corrupting the macro for excel 2016 .xls file?

    ReplyDelete
  39. All VBA password

    https:--home.ayra.ch/unlock

    ReplyDelete
  40. Great usefull tool !!!
    Many thanks to author !!!

    ReplyDelete
  41. You are God to me! I was at the end of the project and that's when the tool was to be given for InfoSec testing. I was directed by my senior to forward the tool with the password for testing. I went to set the password and to my horror the project was locked though I was able to work on the modules all these days. I can't thank you enough for this great help. I searched a lot on this and found out that almost all methods screwed the file rendering it useless which I cannot afford as I had to send the tool. Such a neat way to get this done. Thanks a ton, Anton. Keep up the good work! Take care.

    ReplyDelete
  42. This PDS Excel Password Unlocker is superb solutions for recovery excel file password and unlock Excel worksheet password. It is such easy to recover forgotten MS Excel Password and crack Excel spreadsheet password. Software recover all kind of password alphabetic, numerical, symbolic and special-character of Excel worksheet password and preview of recovery Excel file password.

    Click Here: https://gallery.technet.microsoft.com/Sometime-excel-users-lost-57fcb5d5

    ReplyDelete
  43. Hi,
    i Tried it on 3 Files it work for one but rest two give blank msg at end. can you help me recovering passwords. i tried Zip technique and replaced Dpb value but when i open excel it just do auto repair and remove VBA code.

    ReplyDelete
  44. Hi Anton, if i send you a .xlsm file which is password protected can you unlock?

    ReplyDelete
  45. Hi, if I send a file, can you unlock?

    ReplyDelete
  46. Please check your source file.
    It is need correction as below in ChangeDPBValue function.
    StartPosVal = InStr(1, bytes, "DPB=""", vbTextCompare) + 5

    ReplyDelete
  47. Thanks Anton Pivkach for Excel unlocker _x64.xlsm... Excellent job. God bless you

    ReplyDelete