To see this screen, from within Excel, go to VBA (press ALT + F11), then select Tools from the top menu and then References
Public Sub ProcedureInAccess()
‘this VBA code is run in Excel
Dim acApp As Object
Dim db As Object
Set acApp = CreateObject("Access.Application")
acApp.OpenCurrentDatabase ("C:\MyDatabaseName.mdb")
Set db = acApp
acApp.Run "NameOfProcedureInAccess"
acApp.Quit
Set acApp = Nothing
End Sub
1 comment:
There is little error
You need: Set db = acApp
Not: Set db = CurrentDb
Post a Comment