Quote Originally Posted by GTO

For sendkeys to work, the window has to be visible and have the focus.

Hence - you need to make the vbe window visible before sending keys to the menubar.
well sure and as far as i know, it is visable. both of the examples i have uesed are very similar. the

[vba]
.VBE.CommandBars("Menu Bar").Controls("Tools").Controls("VBAProject Properties...").Execute
[/vba]

gives me an error and i have also tried using the following base code with a few changes but can not get it to work either...

[vba]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 [/vba]