I have Access 2000 code that opens db file and form correctly but recently have added PW protection to the .mdb file and I get a prompt when opening db form from Excel. I've tried to revise the code to include the password and though I've seen various code solutions on Internet to do it, I haven't had any luck. Here is the code, including my numerous attempts with adding PW value. Please, can someone find what I'm doing wrong?! (My PW variable is a string type, like file path variable. Both appear correctly when debugging.)

Dim AppAccess As Object

Set AppAccess = CreateObject("Access.Application")
AppAccess.OpencurrentDatabase (gOpMDBName) 'This works but prompts you for password

' Failed attempts to include password
' AppAccess.OpenCurrentDatabase FileName:=gOpMDBName, Password:=gStdPassword
' AppAccess.OpenCurrentDatabase FileName:=gOpMDBName, Exclusive:=False, Password:=gStdPassword
' Appaccess.OpenCurrentDatabase gOpMDBName, False, gStdPassword
' AppAccess.OpenCurrentDatabase gOpMDBName, gStdPassword

AppAccess.RunCommand 10

With AppAccess
.Visible = True
.DoCmd.OpenForm (FormName)
End With