I am trying get access to automatically run a macro after the vbscript does some file name changes. Everytime I run this function I get an error message stating that Access cannot find the a module named Import. I tried converting the macro to a VBA module then ran the script again to access the module function and got the same error.
This is the function I am using to access the macro.
The script is run from a Windows 98 machine with access installed. The Access database resides on a local NT4.0 server. Any pointers?!
dim dbFortisImport
dbFortisImport= "\\NT4.0_ServerName\Apps\Electronic Transfer\Fortis Transfer.mdb"
dim macro
macro = "Import"
function runMacro(byval dbPath, byval macroName)
'on error resume next
Dim A
Set A = CreateObject("Access.Application"
A.Visible = true
A.OpenCurrentDatabase(dbPath)
A.Run macroName
if err.number <> 0 then
runMacro = "Errors:" & err.description & "<br>"
else
runMacro = "Successful Execution of: " & macroName & " in " & dbpath
end if
a.CloseCurrentDatabase
a.application.Quit
set a = nothing
End function
This is the function I am using to access the macro.
The script is run from a Windows 98 machine with access installed. The Access database resides on a local NT4.0 server. Any pointers?!
dim dbFortisImport
dbFortisImport= "\\NT4.0_ServerName\Apps\Electronic Transfer\Fortis Transfer.mdb"
dim macro
macro = "Import"
function runMacro(byval dbPath, byval macroName)
'on error resume next
Dim A
Set A = CreateObject("Access.Application"
A.Visible = true
A.OpenCurrentDatabase(dbPath)
A.Run macroName
if err.number <> 0 then
runMacro = "Errors:" & err.description & "<br>"
else
runMacro = "Successful Execution of: " & macroName & " in " & dbpath
end if
a.CloseCurrentDatabase
a.application.Quit
set a = nothing
End function