Can anyone show me how I can run a macro from within VB without having to open Access 97 ?
Printable View
Can anyone show me how I can run a macro from within VB without having to open Access 97 ?
This should work (i didn't test it though..)
1) Add a reference to the Microsoft Access 8.0 Object Library
2) Add this code:
Dim axs As New Access.Application
axs.OpenCurrentDatabase ("c:\file\path\here.mdb")
axs.DoCmd.RunMacro "MacroName"
axs.CloseCurrentDatabase
Set axs = Nothing
All done!
HTH
Tom
Thank you Clunietp, that worked fine.
Regards
nmretd