C
crookie74
I have found that it doesn't seem to be easy to set a VBA password
easily from within code. I figure that I probably have to go down the
send keys route and so have set up the following sub
Sub SetVBAPassword()
Dim strPassword As String
strPassword = "monkey"
Excel.SendKeys "%TE^{TAB}VP", False
Excel.SendKeys strPassword & "{TAB}" & strPassword, False
Excel.SendKeys "{Enter}", False
End Sub
My problem is that this code will only work if it is in the same
project as the one you want to set the password for. I want to be able
to set the password from another workbook but don't know how to do it.
Can someone please help me.
easily from within code. I figure that I probably have to go down the
send keys route and so have set up the following sub
Sub SetVBAPassword()
Dim strPassword As String
strPassword = "monkey"
Excel.SendKeys "%TE^{TAB}VP", False
Excel.SendKeys strPassword & "{TAB}" & strPassword, False
Excel.SendKeys "{Enter}", False
End Sub
My problem is that this code will only work if it is in the same
project as the one you want to set the password for. I want to be able
to set the password from another workbook but don't know how to do it.
Can someone please help me.