
Run Access Macro From Excel - VBA
I am trying to run a Macro named Main that I have created
in Access from excel, using VBA. The code I am using is
Sub AccessTest1()
Dim A As Object
Set A = CreateObject("Access.Application")
A.Visible = False
A.OpenCurrentDatabase ("C:\mainCofAwork.mdb")
A.Run "Main"
End Sub
The code runs until it Reaches the A.Run.
That is when I receive the following error message
You may have used the run method in Visual Basic but
entered an invalid procedure name,
or you used the run method without first opening a
database.*You tried to use the OpenModule
method, but you used an invalid procedure name.
Thanks for your help,
Phillip