Question: How can I programmticaly lock and unlock a VBE project?
I can find no objects except the read-only protection and no documentation about
this? Please help.
Thanks
-R-
John Walkenbach
For Excel tips, macros, & downloads...
http://j-walk.com/ss
"RL" <rl...@migkap.com> wrote in message
news:118b01c0e531$6f15ed00$9ee62ecf@tkmsftngxa05...
You can't.
>I can find no objects except the read-only protection and no documentation
>about this? Please help.
That's because they don't exist. Call Microsoft and give em what for.
Joe
The code is placed in the workbook open event and it only unlocks the
project if the user name is correct. You can just get rid of the if / end
if part of the routine for your purposes.
Sub UnlockProject() 'Workbook Open Event
dim v as string
v = Application.UserName
If v = "aaa" Or v = "rlm" Then
With Application
' OPEN VB EDITOR
.SendKeys "%{F11}", True
' TOOLS
.SendKeys "%T", True
' PROJECT PROPERTIES
.SendKeys "E", True
.SendKeys "mypassword" ' PASSWORD
.SendKeys "~", True ' ENTER
.SendKeys "~", True ' ENTER
' CLOSE THE EDITOR.
.SendKeys "%FC"
End With
End If
End Sub
Regards Rocky