• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5529
  • Last Modified:

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.
0
kris_sk2012
Asked:
kris_sk2012
1 Solution
 
CompProbSolvCommented:
This is info for Access 2007.  2010 is likely the same:
http://office.microsoft.com/en-us/access-help/command-line-switches-for-access-HA010166605.aspx

The example given there is:
msaccess.exe /ro "c:\MyFolder\MyDatabase.accdb" /x MyMacro
0
 
als315Commented:
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

0
 
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.
0
 
als315Commented:
You should add DB folder to trusted and close Access in the end of your macro
Test sample with macro M1
DBMacro.accdb
0
 
Jeffrey CoachmanCommented:
<have a batch script to execute the command every day>
Is this command a mystery?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now