Question Locked

Running an Access Macro from and Excel Macro

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi

Does anybody know what the code might be for running an access db macro from excel?

Thanks

Steve

2 replies

by bigtul

This should do the trick, it does for me.

Sub test()
DatabaseName$ = "c:\yourdatabase.mdb"
Set acapp = CreateObject("Access.Application")
acapp.Visible = False
acapp.OpenCurrentDatabase (DatabaseName$)
acapp.DoCmd.RunMacro "mcrYourmacroName"
acapp.closecurrentdatabase
End Sub

Enjoy.

This discussion is closed to new replies.