I'm trying to call a subroutine in an Access database from Excel. This sub then call a number of other subroutines, all contained within the database. I saw a number of other posts where this was discouraged, but for reasons, Excel needs to be the front-end for this. I tried:
Sub TestRun()
Dim acObj As Access.Application
Set acObj = CreateObject("Access.Application")
acObj.Application.Visible = True
acObj.OpenCurrentDatabase "C:\testMDB\TEST.mdb", False, "password"
acObj.Application.Run ("TestRunAccess")
End Sub
The database is part of a workgroup with a password - running it this way still prompts for the password. I'm not very familiar with Access - how would I go about doing this? What references would I need to include?
That would be:
You may prefer to use late binding if you wish to avoid problems with references, in which case: