troubleshooting Question

How to pass VBE password from a form

Avatar of patrickgermain
patrickgermainFlag for France asked on
Microsoft ApplicationsMicrosoft Access
6 Comments3 Solutions657 ViewsLast Modified:
A have a form which need transfert Form and module import from an another database
The user don't know VBE pwd
I have this code which do it
But sometimes, it don't work good and the user get a msgbox asking password and after get the windows of VBE propriety
Otherwise it work good and the user see nothing
I put the code after
If you have remarks Thanks
Sub Autorise
    Dim proj As Object
    Dim data As String
    If Me.On_error Then On Error GoTo ErreurVB
    Set proj = Application.VBE.activeVBProject
'    DoEvents                                      ' i don't know if useful ?
    data = "xxxxx{TAB}~~"                   ' xxxxx is the password
    Sleep 100
    SendKeys data, True   '  pwd + Tab + 2 return to close propriety windows
    Application.VBE.CommandBars(1).FindControl(msoControlButton, id:=2578, Visible:=True, recursive:=True).Execute
    Exit Sub

Open in new window

Join our community to see this answer!
Unlock 3 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros