Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Alter Mulitple Protected VB Modules

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default Alter Mulitple Protected VB Modules

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Alter Mulitple Protected VB Modules

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Alter Mulitple Protected VB Modules

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Alter Mulitple Protected VB Modules

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Alter Mulitple Protected VB Modules

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Alter Mulitple Protected VB Modules

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alter mulitple Vlookups at once MikeD1224 Excel Discussion (Misc queries) 2 February 16th 07 09:55 PM
VBA password protected modules MikeFullam Excel Discussion (Misc queries) 1 April 25th 06 09:42 AM
Protected modules MikeFullam Excel Discussion (Misc queries) 0 April 25th 06 09:04 AM
Export modules from protected projects Frederick Chow Excel Programming 0 March 21st 06 05:02 PM
Unlocking pwd protected vba modules Dan Thompson Excel Programming 1 October 7th 05 12:39 AM


All times are GMT +1. The time now is 01:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"