Guys,
The company I work employed some consulants a couple of years ago and they built some good stuff in excel. The consultancy no longer exists and we want to make changes to the underlying VBA. The problem we have is that the VBA is password protected and they never left us with the passwords. Does anybody know if there is a way round this?
We are usig Excel 2003 SP2
Many thanks,
Jim.
Unlocking VBA Scripts
- jim wood
- Site Admin
- Posts: 3958
- Joined: Wed May 14, 2008 1:51 pm
- OLAP Product: TM1
- Version: PA 2.0.7
- Excel Version: Office 365
- Location: 37 East 18th Street New York
- Contact:
Unlocking VBA Scripts
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
-
- Site Admin
- Posts: 6643
- Joined: Sun May 11, 2008 2:30 am
- OLAP Product: TM1
- Version: PA2.0.9.18 Classic NO PAW!
- Excel Version: 2013 and Office 365
- Location: Sydney, Australia
- Contact:
Re: Unlocking VBA Scripts
No easy way around it I'm afraid, Jim. (As in, unlike breaking worksheet or workbook protection, a few lines of code won't do it.)jim wood wrote: The company I work employed some consulants a couple of years ago and they built some good stuff in excel. The consultancy no longer exists and we want to make changes to the underlying VBA. The problem we have is that the VBA is password protected and they never left us with the passwords. Does anybody know if there is a way round this?
I suggest that you take a look at this page on JE McGimpsey's site:
http://www.mcgimpsey.com/excel/fileandvbapwords.html
and this one on Chip Pearson's:
http://cpearson.com/excel/password.htm
Now I've never used any of the products / services either; I downloaded a demo of one a few years back which promised to return the first two characters of the password, and it did, without fail. (Can't recall the name of it now.) So some of these apps will clearly work, though you have to pay a few bucks for them.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-
- MVP
- Posts: 3698
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Unlocking VBA Scripts
Workbook and worksheet passwords are trivial to crack with VBA once the workbook is already open, however the workbook open and VBA module passwords have much stronger encryption and can only be cracked with brute force. There is software out there to break the passwords which Alan has provided links to but depending on the strength of the password and the algorithm the program uses it might still take hours and hours to break the password.
The company might not exist any more but why not call one of the consultants and ask for the password?
The company might not exist any more but why not call one of the consultants and ask for the password?
-
- MVP
- Posts: 3222
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.1.5
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: Unlocking VBA Scripts
Hi
I have a program to convert the VBA password into another password (that you know then). It cannot (or won't) tell you the previous password. If interested, leave me a PM Jim.
Wim
I have a program to convert the VBA password into another password (that you know then). It cannot (or won't) tell you the previous password. If interested, leave me a PM Jim.
Wim
Best regards,
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Posts: 6
- Joined: Thu Feb 21, 2013 2:56 pm
- OLAP Product: TM1
- Version: 9.5.2 FP3
- Excel Version: 2010 and 2013 32bit
Re: Unlocking VBA Scripts
For xls and xla formats
1. Open the file with a hex editor. I use freeware HxD because it was included in the LiberKey Suite.
2. Do a string search for "DPB" and replace that with "DPx".
3. Save the file with a new name so you do not overwrite the original.
4. Open the xls/xla with Excel. On file opened, you will get many errors - just click "OK" through them all.
5. Go the Visual Basic Editor (Alt+F11).
6. Access the VBAProject Properties of the subject file by either right clicking the file or by using the Tools menu in the toolbar.
7. On the Protection tab make a new password that you will remember.
8. Save the file and open it again
9. Go the Visual Basic Editor (Alt+F11) and remove the password using the password you created in step 7.
10. Save the file
The VBA is now unprotected
For .xlsm formats
1. Change .xlsm extension to .zip
2. Open the zipped folder and navigate into the “xl” folder
3. Extract the vbaProject.bin file and open it in a Hex Editor
4. Search for “DPB” and replace with “DPx”
5. Replace the old vbaProject file with this new one in the zip folder (and re-zip)
6. Change the file extension back to .xlsm
7. Open workbook and ignore all warning messages
8. Export the code modules and then re-add them (delete the old ones)
1. Open the file with a hex editor. I use freeware HxD because it was included in the LiberKey Suite.
2. Do a string search for "DPB" and replace that with "DPx".
3. Save the file with a new name so you do not overwrite the original.
4. Open the xls/xla with Excel. On file opened, you will get many errors - just click "OK" through them all.
5. Go the Visual Basic Editor (Alt+F11).
6. Access the VBAProject Properties of the subject file by either right clicking the file or by using the Tools menu in the toolbar.
7. On the Protection tab make a new password that you will remember.
8. Save the file and open it again
9. Go the Visual Basic Editor (Alt+F11) and remove the password using the password you created in step 7.
10. Save the file
The VBA is now unprotected
For .xlsm formats
1. Change .xlsm extension to .zip
2. Open the zipped folder and navigate into the “xl” folder
3. Extract the vbaProject.bin file and open it in a Hex Editor
4. Search for “DPB” and replace with “DPx”
5. Replace the old vbaProject file with this new one in the zip folder (and re-zip)
6. Change the file extension back to .xlsm
7. Open workbook and ignore all warning messages
8. Export the code modules and then re-add them (delete the old ones)