Run Access Macro from command line

Can I run an Access (2010) macro from command line? The idea is to have a batch script to execute the command every day.
Who is Participating?
This is info for Access 2007.  2010 is likely the same:

The example given there is:
msaccess.exe /ro "c:\MyFolder\MyDatabase.accdb" /x MyMacro
Usually you should use full path to msaccess.exe and ro is read only.
Sample cntent of cmd file:
"c:\Program Files\Microsoft Office\Office14\MSACCESS.EXE"  "\\MyServer\DB\test.accdb" /X M1

Open in new window

kris_sk2012Author Commented:
Thanks  - but I keep getting warning messages and they are interrupting the command execution. Any way to suppress them.
Also Access doesn't close automatically and stays open after the command executes. I need it to Close.
You should add DB folder to trusted and close Access in the end of your macro
Test sample with macro M1
Jeffrey CoachmanMIS LiasonCommented:
<have a batch script to execute the command every day>
Is this command a mystery?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.