View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default vba project properties via code


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