Avatar of DCRAPACCESS
DCRAPACCESS

asked on 

Run Access code from Excel

Hi Experts,

I have a access database with a Sub, that i would like to execute from Excel.

I have found this code, that works:
Dim A As Object
Set A = CreateObject("Access.Application")
A.Visible = True
A.OpenCurrentDatabase ("C:\Documents and Settings\rcrill\My
Documents\Ref_Code\ImportExcel.mdb")
A.Run "ImportExcel"<---------------------This Fails
A.Quit

Open in new window


But i my case the database is already open, so is it possible to just tell the already open database to just run the Sub without opening the same database again?
 
Microsoft AccessMicrosoft Excel

Avatar of undefined
Last Comment
phackwer

8/22/2022 - Mon