G
Guest
Hello,
I am stumped!! The following code (which I have used
several times before for other purposes) is written in
Excel VBA and runs a macro in Access. The Access macro
opens an Access Form which based on the users inputs then
runs various queries. The Excel macro continues after the
form is opened and run. The reason I created the Access
macro that opens the form, is so the Excel Macro will wait
for the Access Queries to finish, before continuing on
with the additional Excel code. The only portion of this
code I have not used in the past is the password portion,
but I am continually getting a Runtime Error 2501 on the
the RunMacro portion. The macro and form run perfectly in
Access, just not in Excel from this code. Any
suggestions???
Dim dba As Access.Application
Dim stgPath As String
Set dba = CreateObject("Access.Application")
stgPath = ("N:\MTR\oss\sOutlook\sAct.mdb")
dba.OpenCurrentDatabase filepath:=stgPath,
Exclusive:=False, bstrPassword:="password"
dba.DoCmd.RunMacro "Open"
I am stumped!! The following code (which I have used
several times before for other purposes) is written in
Excel VBA and runs a macro in Access. The Access macro
opens an Access Form which based on the users inputs then
runs various queries. The Excel macro continues after the
form is opened and run. The reason I created the Access
macro that opens the form, is so the Excel Macro will wait
for the Access Queries to finish, before continuing on
with the additional Excel code. The only portion of this
code I have not used in the past is the password portion,
but I am continually getting a Runtime Error 2501 on the
the RunMacro portion. The macro and form run perfectly in
Access, just not in Excel from this code. Any
suggestions???
Dim dba As Access.Application
Dim stgPath As String
Set dba = CreateObject("Access.Application")
stgPath = ("N:\MTR\oss\sOutlook\sAct.mdb")
dba.OpenCurrentDatabase filepath:=stgPath,
Exclusive:=False, bstrPassword:="password"
dba.DoCmd.RunMacro "Open"