Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
We have an engineer here who created a highly useful
workbook with VB Modules. He password protected the VBA Project. Unfortunately, he hard-coded a network path in these modules, and that path must change for reasons beyond our control. The problem is that this workbook has been copied literally thousands of times. All of them need to be fixed. They are all on mapped network drives that I can access, so I know where all the copies are. I've been looking for some way to automate a find / replace on all these workbooks, but I see there is no good way to use VBA to unprotect the modules. I'm not restricted to VB or VBA. I could do something in VC++ or Perl or whatever. Any suggestions on how to do the fix? Right now, he's facing the possibility of having to manually open and unprotect thousands of workbooks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bio,
I always feel inferior to the large brains in here, but I did go to the trouble to place my path and file specs in cells on a separate worksheet in my main file. That might be worth a look to avoid this problem in the future. I lost the VBA password to my main file and eventually had to order a VBA password cracker from Passware (lostpassword.com). At $45, I though it was a bit steep, but it surely did the job (in about 2 seconds). They might be able to work with you if you contact them and explain the problem. I think they had a 'contact us' link on the website, but if not, their phone is 952-646-5526. They certainly don't give away their stuff (there is a free version to crack passwords of two characters or less), but it might be worth it if you total up the enginner's time to manually enter all those passwords. With the breadth of programming you have at your disposal, you might be able to come up with a way to open the files, crack the pw with their stuff, and change the path. Well, a suggestion. James wrote: We have an engineer here who created a highly useful workbook with VB Modules. He password protected the VBA Project. Unfortunately, he hard-coded a network path in these modules, and that path must change for reasons beyond our control. The problem is that this workbook has been copied literally thousands of times. All of them need to be fixed. They are all on mapped network drives that I can access, so I know where all the copies are. I've been looking for some way to automate a find / replace on all these workbooks, but I see there is no good way to use VBA to unprotect the modules. I'm not restricted to VB or VBA. I could do something in VC++ or Perl or whatever. Any suggestions on how to do the fix? Right now, he's facing the possibility of having to manually open and unprotect thousands of workbooks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am hoping to take this time to alter the thing so it's immune to
future path changes. Putting this on one of the sheets is good idea. You CAN unlock those via code if you need to. Zone wrote: Bio, I always feel inferior to the large brains in here, but I did go to the trouble to place my path and file specs in cells on a separate worksheet in my main file. That might be worth a look to avoid this problem in the future. I lost the VBA password to my main file and eventually had to order a VBA password cracker from Passware (lostpassword.com). At $45, I though it was a bit steep, but it surely did the job (in about 2 seconds). They might be able to work with you if you contact them and explain the problem. I think they had a 'contact us' link on the website, but if not, their phone is 952-646-5526. They certainly don't give away their stuff (there is a free version to crack passwords of two characters or less), but it might be worth it if you total up the enginner's time to manually enter all those passwords. With the breadth of programming you have at your disposal, you might be able to come up with a way to open the files, crack the pw with their stuff, and change the path. Well, a suggestion. James wrote: We have an engineer here who created a highly useful workbook with VB Modules. He password protected the VBA Project. Unfortunately, he hard-coded a network path in these modules, and that path must change for reasons beyond our control. The problem is that this workbook has been copied literally thousands of times. All of them need to be fixed. They are all on mapped network drives that I can access, so I know where all the copies are. I've been looking for some way to automate a find / replace on all these workbooks, but I see there is no good way to use VBA to unprotect the modules. I'm not restricted to VB or VBA. I could do something in VC++ or Perl or whatever. Any suggestions on how to do the fix? Right now, he's facing the possibility of having to manually open and unprotect thousands of workbooks. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I understand correctly our issue is not one of not knowing the password,
it is how to modfy the existing code which is password protected. The short answer is No. There is no relyable method of unlocking a password protected project via code. You can use send keys but... No guarantees... -- HTH... Jim Thomlinson " wrote: I am hoping to take this time to alter the thing so it's immune to future path changes. Putting this on one of the sheets is good idea. You CAN unlock those via code if you need to. Zone wrote: Bio, I always feel inferior to the large brains in here, but I did go to the trouble to place my path and file specs in cells on a separate worksheet in my main file. That might be worth a look to avoid this problem in the future. I lost the VBA password to my main file and eventually had to order a VBA password cracker from Passware (lostpassword.com). At $45, I though it was a bit steep, but it surely did the job (in about 2 seconds). They might be able to work with you if you contact them and explain the problem. I think they had a 'contact us' link on the website, but if not, their phone is 952-646-5526. They certainly don't give away their stuff (there is a free version to crack passwords of two characters or less), but it might be worth it if you total up the enginner's time to manually enter all those passwords. With the breadth of programming you have at your disposal, you might be able to come up with a way to open the files, crack the pw with their stuff, and change the path. Well, a suggestion. James wrote: We have an engineer here who created a highly useful workbook with VB Modules. He password protected the VBA Project. Unfortunately, he hard-coded a network path in these modules, and that path must change for reasons beyond our control. The problem is that this workbook has been copied literally thousands of times. All of them need to be fixed. They are all on mapped network drives that I can access, so I know where all the copies are. I've been looking for some way to automate a find / replace on all these workbooks, but I see there is no good way to use VBA to unprotect the modules. I'm not restricted to VB or VBA. I could do something in VC++ or Perl or whatever. Any suggestions on how to do the fix? Right now, he's facing the possibility of having to manually open and unprotect thousands of workbooks. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim Thomlinson wrote:
If I understand correctly our issue is not one of not knowing the password, it is how to modfy the existing code which is password protected. The short answer is No. There is no relyable method of unlocking a password protected project via code. You can use send keys but... No guarantees... -- HTH... Jim Thomlinson I wouldn't want to rely on SendKeys with this many files. I've had bad luck with that sort of thing. What about a C program to open the workbooks as binary files, and make the alteration? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Open up one of the Excel files with a hex editor and take a look at it. It
might give you some insight into how you might (emphasis on might) be able to do this. Most of the file will look like typical binary file with the exception of a few non-tokenized tid bits of joy and happyness. If the path was stored as a constant then you might (emphasis on might) be in luck. That being said you could also corrupt the files... Before you run any C script on the files make darn sure you have a good set of backups. -- HTH... Jim Thomlinson " wrote: Jim Thomlinson wrote: If I understand correctly our issue is not one of not knowing the password, it is how to modfy the existing code which is password protected. The short answer is No. There is no relyable method of unlocking a password protected project via code. You can use send keys but... No guarantees... -- HTH... Jim Thomlinson I wouldn't want to rely on SendKeys with this many files. I've had bad luck with that sort of thing. What about a C program to open the workbooks as binary files, and make the alteration? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In light testing a hard coded string appears to remain intact in the file,
even in a pw protected and compiled wb. Have a look at the this set of routines. http://tinyurl.com/j9dke In hasCode() change ba() = "_VBA_PROJECT_CUR" to ba() = "your-path" and delete the 'Step 2' here For j = 0 To UBound(ba) Step 2 in Sub Test() change sFolder = Application.DefaultFilePath & "\" to sFolder = "path-with-a-lot-of-files" ' can adapt later to do subfolders So the first question is does this successfully find the hard coded string in all anticipated files. If yes it would be simple enough to replace and 'print' back to file. But I don't know if changing the length of the string, and hence the length of the file will throw various internal pointers. I haven't tested, but maybe you can and let us know. Regards, Peter T wrote in message ups.com... Jim Thomlinson wrote: If I understand correctly our issue is not one of not knowing the password, it is how to modfy the existing code which is password protected. The short answer is No. There is no relyable method of unlocking a password protected project via code. You can use send keys but... No guarantees... -- HTH... Jim Thomlinson I wouldn't want to rely on SendKeys with this many files. I've had bad luck with that sort of thing. What about a C program to open the workbooks as binary files, and make the alteration? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Alter mulitple Vlookups at once | Excel Discussion (Misc queries) | |||
VBA password protected modules | Excel Discussion (Misc queries) | |||
Protected modules | Excel Discussion (Misc queries) | |||
Export modules from protected projects | Excel Programming | |||
Unlocking pwd protected vba modules | Excel Programming |