ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unlock Protected VBAProject via code (https://www.excelbanter.com/excel-programming/416790-unlock-protected-vbaproject-via-code.html)

ExcelMonkey

Unlock Protected VBAProject via code
 
Is there a way to unlock a VBAProject via code other than using the SendKey
method?

The reason I ask is that I have a large number of file to go through which
have projected VBAProjects. The users are providing me with the passwords in
advance. I simply want to automate the process

Thanks

EM

Bob Phillips[_3_]

Unlock Protected VBAProject via code
 
Sendkeys is the only automated way that I know of.

--
__________________________________
HTH

Bob

"ExcelMonkey" wrote in message
...
Is there a way to unlock a VBAProject via code other than using the
SendKey
method?

The reason I ask is that I have a large number of file to go through which
have projected VBAProjects. The users are providing me with the passwords
in
advance. I simply want to automate the process

Thanks

EM




ExcelMonkey

Unlock Protected VBAProject via code
 
Thanks Bob

EM

"Bob Phillips" wrote:

Sendkeys is the only automated way that I know of.

--
__________________________________
HTH

Bob

"ExcelMonkey" wrote in message
...
Is there a way to unlock a VBAProject via code other than using the
SendKey
method?

The reason I ask is that I have a large number of file to go through which
have projected VBAProjects. The users are providing me with the passwords
in
advance. I simply want to automate the process

Thanks

EM





Charlotte E.

Unlock Protected VBAProject via code
 
Is there a way to unlock a VBAProject via code other than using the
SendKey
method?


How to do that with SendKey???



Bob Phillips[_3_]

Unlock Protected VBAProject via code
 
You would still need to know the password, it is not a cracking method

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

"Charlotte E." wrote in message
...
Is there a way to unlock a VBAProject via code other than using the
SendKey
method?


How to do that with SendKey???




ExcelMonkey

Unlock Protected VBAProject via code
 
Correct me if I am wrong Bob but isn't the issue with this method that you
really don't know (in advance) how many TABs you will have to press to
navigate down the items in the Project window? It's obvious when you are
looking at the Project window once teh IDE is open.

I am assuming this is an issue as the items will be a function of all the
Add-ins you have loaded in your Excel and the files you current have open on
your computer.

Thanks

EM

"Bob Phillips" wrote:

You would still need to know the password, it is not a cracking method

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

"Charlotte E." wrote in message
...
Is there a way to unlock a VBAProject via code other than using the
SendKey
method?


How to do that with SendKey???





ExcelMonkey

Unlock Protected VBAProject via code
 
One last question Bob. Would this be any easiser using VB (.Net)? Or is
this irrelevant as there is not any exposure to the Object model period?

Thanks

EM

"Bob Phillips" wrote:

You would still need to know the password, it is not a cracking method

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

"Charlotte E." wrote in message
...
Is there a way to unlock a VBAProject via code other than using the
SendKey
method?


How to do that with SendKey???





Bob Phillips[_3_]

Unlock Protected VBAProject via code
 
Yes, you are absolutely correct, which is why I said that it needs tuning.

It isn't failsafe, Sendkeys never is. Personally, I am lost as to why anyone
needs this.

--
__________________________________
HTH

Bob

"ExcelMonkey" wrote in message
...
Correct me if I am wrong Bob but isn't the issue with this method that you
really don't know (in advance) how many TABs you will have to press to
navigate down the items in the Project window? It's obvious when you are
looking at the Project window once teh IDE is open.

I am assuming this is an issue as the items will be a function of all the
Add-ins you have loaded in your Excel and the files you current have open
on
your computer.

Thanks

EM

"Bob Phillips" wrote:

You would still need to know the password, it is not a cracking method

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

"Charlotte E." wrote in message
...
Is there a way to unlock a VBAProject via code other than using the
SendKey
method?

How to do that with SendKey???







Bob Phillips[_3_]

Unlock Protected VBAProject via code
 
I can't say for sure, Net is a new world for me, but I cannot see how it
would be.

Maybe you could iterate through the projects in the VBIDE, sort them, and
then work out where in the list the target project is.

--
__________________________________
HTH

Bob

"ExcelMonkey" wrote in message
...
One last question Bob. Would this be any easiser using VB (.Net)? Or is
this irrelevant as there is not any exposure to the Object model period?

Thanks

EM

"Bob Phillips" wrote:

You would still need to know the password, it is not a cracking method

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

"Charlotte E." wrote in message
...
Is there a way to unlock a VBAProject via code other than using the
SendKey
method?

How to do that with SendKey???








All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com