I am trying to run a macro in a password protected database, however the script doesn't actually enter the password in the password section so unless I manually key it in I can not open it.
The password is correct.
The password is correct.
Code:
Sub Test1()
Dim app As Access.Application
'Start a new MSAccess application
Set app = New Access.Application
'Open the remote database and run a macro, then close the remote database
With app
.OpenCurrentDatabase "X:\Test\Test1.mdb", True, "helpme"
.DoCmd.RunMacro "UTTest1"
'.CloseCurrentDatabase
End With
'Quit the spawned app
'app.Quit acQuitSaveNone
'Set app = Nothing
'Quit the current app
'Application.Quit acQuitSaveNone
End Sub