Thursday, 6 December 2012


For Excel 2007/2010 (.xlsm) files do following steps:

1. Create a new .xlsm file.
2. In the VBA part, set a simple password (for instance 'macro').
3. Save the file and exit.
4. Change file extention to '.zip', open it by any archiver program.
5. Find the file: 'vbaProject.bin' (in 'xl' folder).
6. Extract it from archive.
7. Open the file you just extracted with a hex editor (for example HxD).
8. Find and copy the value from parameter DPB (value in quotation mark), example:
        DPB="282A84CBA1CBA1345FCCB154E20721DE77F7D2378D0EAC90427A22021A46E9CE6F17188A".  (This value generated for 'macro' password. You can use this DPB value to skip steps 1-8)

9. Do steps 4-7 for file with unknown password (file you want to unlock).
10. Change DBP value in this file on value that you have copied in step 8.
>>If copied value is shorter than in encrypted file you should populate missing characters with 0 (zero). If value is longer - that is not a problem (paste as it is).

11. Save the 'vbaProject.bin' file and exit from hex editor.
12. Replace existing 'vbaProject.bin' file with modified one.
13. Change extention from '.zip' back to '.xlsm'
14. Now, open the excel file you need to see the VBA code in. The password for the VBA code
will simply be macro (as in the example I'm showing here).

For those who still using old file format (2003 - .xls) method has less steps:

1. Open .xls file with hex editor (for example HxD).
2. Find parameter DPB, change value for this parameter by our own. If your value is shorter than value in encrypted file, you should populate missing characters with 0 (zero). If value is longer - that is not a problem (paste as it is).

DPB="282A84CBA1CBA1345FCCB154E20721DE77F7D2378D0EAC90427A22021A46E9CE6F17188A".  (This value generated for 'macro' password).
3. Save changes.

36 comments:

  1. Hi! That worked for me. Brilliant... Thanks..

    Although, I don't think we really need the hex editors here. Just a thought.

    ReplyDelete
  2. A simpler way I read about is to load the file in Notepad, search for "DPB" and change the text to "DPx" leaving everything else the same and save. When you load the file back into Excel it detects an error, fixes it by removing the password and then the VBA is unlocked with no password. But thanks, your write-up pointed in the right direction.

    ReplyDelete
    Replies
    1. Resently I made a marco which can do all the steps automatically, it's much simplier. I could not found similar macro in the Internet, which is quite interesting, maybe because the issue with 'password forgeting' is not actual.
      http://lbeliarl.blogspot.cz/2014/01/vba-password-remover.html

      Delete
    2. It removes VBA Module from file.. trick not functional

      Delete
  3. Amazing, luar biasa. Kok jadinya gak ada password apapun yang ampuh ya?
    Apa ada juga cara untuk membuka file excel/word yang kita lupa passwordnya?

    ReplyDelete
  4. It doesn't work. I have tried a several times, but not working. is there an option at least to unhide hidden sheets that are protected

    ReplyDelete
  5. i've tried with Excel 2013 and no result (file not readable... Excel try to repair it and propose to remove VBAProject). I don't know if working on 2007/2010

    ReplyDelete
    Replies
    1. Maybe you've missed some instructions. If you send me the file I could check.

      Delete
  6. Hi Anton, Has Excel fixed the glitch? I can't find vbaproject.bin under xl folder.

    ReplyDelete
    Replies
    1. Some more context : when I replace .xslm by .zip, I do see the 'xl' folder - but I am missing the vbaproject.bin file, I can't see it. Do you think Excel hid it?

      Delete
    2. Hi Aurelien. The 'vbaProject.bin' should be inside of 'xl' folder, did you look there?

      Delete
    3. Hi Anton, I did. I can only see the following under xl :
      folder _rels
      folder macrosheets
      folder theme
      folder worksheets
      styles.xml
      workbook.xml
      and non of the subfolder seems to have vbaproject.bin. I am puzzled...

      Delete
  7. Then it means that your file don't have VBA module/form or class, there is no way that this file could be hidden inside of zip archive. Are you able to see any VBAProject('file name') in VBA editor in your file (Alt+F11)?

    ReplyDelete
    Replies
    1. So I found an already existing unprotected .xlsm file and it fixed it... rather than creating a .xlsm from scratch. It worked!!

      Delete
  8. ​Thanks, a great article. I wish a similar method existed for the Word docs that are password protected from opening. I had one with a forgotten password, and I did have to use a commercial tool, namely the Password-find.com service that from what I know supports VBA project passwords too. It did the trick, but did cost money. Hope more freeware tools will appear on the web soon.

    ReplyDelete
    Replies
    1. Thank you very much!!! i could unprotect my xla file on this service (https://www.password-find.com) for FREE! I didn't expect this.

      Delete
    2. Actually it worked only once for free.. now it is asking for 19$.

      Delete
  9. I had to modify the code a little. Kept getting a "do you want to replace the .bin?" dialog box. The macro would move on and delete the tmp file before it was moved. Added a pause via msgbox "Press OK when compression is complete".

    ReplyDelete
  10. Hi Anton
    I've tried with a file in Excel 2007 and It doesn't work. Could you please give me your email?

    ReplyDelete
  11. Thanks Anton - superb stuff

    ReplyDelete
  12. I am really satisfied with this posting that you have given us. This is really a stupendous work done by you.
    stillandhouse |

    lathamsinterior |

    hunkydory-home |

    treehousepastryshop |

    futurehelphomes |

    natickhouse |

    okhomewindows |

    auditmyhometoday |

    okhomeexteriors |

    yournexthomeexterior |

    ReplyDelete
  13. You’ve got some interesting points in this article. I would have never considered any of these if I didn’t come across this. Thanks!.
    adsprofitreward |

    fullbusiness |

    doralbusiness |

    millerhillbusiness |

    armturkbusiness |

    businessimperial |

    digitalisbusiness |

    burnin4business |

    cannabusinessschool |

    corebusinessbank |

    ReplyDelete
  14. Perfect! Thanks a lot! It worked for me!!!!

    ReplyDelete
  15. Im using 2010xl and when i try to open the changed xlsm file, excel says it repaired it and deletes the vba project from the file entirely. Im using xp btw

    ReplyDelete
  16. Nice information, many thanks to the author. I believe that anyone who wants to know something about this topic will like the post.I really loved reading blog
    plak bh

    ReplyDelete
  17. You can easily unlock Excel xlsm file password with the use of eSoftTools XLSM file password unlocker software. With this application crack lost or forgotten password from xls, xlsx, xlsm, xltm, xla, xlam and xlsb files.

    Read More
    http://www.excelpasswordcracker.esofttools.com

    ReplyDelete
  18. Best and safe Excel password breaker to know how to break Excel password and recover Excel password with all versions Excel file including xlsx, xls, xlsb, xla, xlam, xltm and xlsm
    Click here: http://www.2016.excelfilepasswordrecovery.com

    ReplyDelete
  19. You can download PDS Excel Password Recovery tool smartly recover lost or forgotten MS Excel file password and unlock excel sheet protection password in easy way.

    Click Here: http://www.perfectdatasolutions.com/excel-password-recovery-software.html

    ReplyDelete
  20. Every post containing a lot of information has its own value and everybody love it.
    plak beha

    ReplyDelete
  21. All the contents you mentioned in post are too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.plak beha kopen

    ReplyDelete
  22. usefull thank you for your post

    ReplyDelete
  23. Super, thanks a lot. you are really saved my day.

    ReplyDelete
  24. In case any reason you forget excel password and you have to open it, so download eSoftTools Excel Password Recover Software to recover excel file password with Dictionary Attack. Excel Password Unlocker Software ready to break excel password with no damage any excel data, it unlock word and access file password and support all excel version 2019, 2016, 2013, 2010, 2007, 2003, 2002, 2000, 97.

    More Info:- https://www.esofttools.com/excel-password-recovery.html

    ReplyDelete