Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a rather large group of files to modify. The vba modules of each are
'nearly' identical, and I need to add or remove code from each one. I have the code in place to modify them, but each one has their vba project password protected (al with the same passord). How do I pass the password to the project from within my code to unlock those other projects before I modify them. (Note I do not wish to remove the protection, just open the projects, modify and get out again.) If I open them and unlock manually, it could take me days, and the point of my project is to do this in a matter of minutes, to force them all to use the same external code for their processing. Thanks!! Tim |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() It can be done, but it involves the use of SendKeys which isn't too stable. This is an example, but you may need to tune it With Application .SendKeys "%{F11}", True ' VBE .SendKeys "^r", True ' Set focus to Explorer .SendKeys "{TAB}", True ' Tab to locked project .SendKeys "~", True ' Enter .SendKeys "password" .SendKeys "~", True ' Enter End With -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Tim Rush" wrote in message ... I have a rather large group of files to modify. The vba modules of each are 'nearly' identical, and I need to add or remove code from each one. I have the code in place to modify them, but each one has their vba project password protected (al with the same passord). How do I pass the password to the project from within my code to unlock those other projects before I modify them. (Note I do not wish to remove the protection, just open the projects, modify and get out again.) If I open them and unlock manually, it could take me days, and the point of my project is to do this in a matter of minutes, to force them all to use the same external code for their processing. Thanks!! Tim |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Great... Took me a while to figure what was happening, but I mangaed to use
it. First time using SendKeys. I can see its instability, but if careful, it could be powerful too. Since I found no way to tell it which workbook to tab through, I cycled it through all of them. The active workbook is not always the first one listed. Thanks for the help! "Bob Phillips" wrote: It can be done, but it involves the use of SendKeys which isn't too stable. This is an example, but you may need to tune it With Application .SendKeys "%{F11}", True ' VBE .SendKeys "^r", True ' Set focus to Explorer .SendKeys "{TAB}", True ' Tab to locked project .SendKeys "~", True ' Enter .SendKeys "password" .SendKeys "~", True ' Enter End With -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Tim Rush" wrote in message ... I have a rather large group of files to modify. The vba modules of each are 'nearly' identical, and I need to add or remove code from each one. I have the code in place to modify them, but each one has their vba project password protected (al with the same passord). How do I pass the password to the project from within my code to unlock those other projects before I modify them. (Note I do not wish to remove the protection, just open the projects, modify and get out again.) If I open them and unlock manually, it could take me days, and the point of my project is to do this in a matter of minutes, to force them all to use the same external code for their processing. Thanks!! Tim |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi Tim,
you can use SendKeys to unlock vba protection pw = "password" SendKeys "%{F11}%xi" & pw & "{ENTER}{TAB 6}{ENTER}", True don`t know if this still works with XL2007. stefan On 9 Jun., 13:05, Tim Rush wrote: I have a rather large group of files to modify. *The vba modules of each are 'nearly' identical, and I need to add or remove code from each one. *I have the code in place to modify them, but each one has their vba project password protected (al with the same passord). * How do I pass the password to the project from within my code to unlock those other projects before I modify them. *(Note I do not wish to remove the protection, just open the projects, modify and get out again.) If I open them and unlock manually, it could take me days, and the point of my project is to do this in a matter of minutes, to force them all to use the same external code for their processing. Thanks!! Tim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Project Explorer and Properties window (VBA) have disappeared | Excel Programming | |||
Docking Project Explorer, Properties window and Code window in VBE | Setting up and Configuration of Excel | |||
Workbook with no properties attaches itself to my VBA project | Excel Discussion (Misc queries) | |||
VBA Project Properties | Excel Programming | |||
Locking VBA code via Project properties but cannot save the workbook over itself | Excel Programming |