Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Run MS Access Macro using Task Scheduler

Run MS Access Macro using Task Scheduler

Run MS Access Macro using Task Scheduler

Does anyone have any documentation about using Windows Task Scheduler to launch a MS Access macro? What is the syntax / or pathing needed to accomplish this. I cannot find ANY documentation on this matter.

I have done this before and I seem to remember the path was somthing like

"[directory path to MS Access exe file]" "[directory path to MS Acces *.mdb file]" ....(don't remember the rest...)

I appreciate your help with this!

RE: Run MS Access Macro using Task Scheduler

You're just about there, add /x MacroName to execute the macro of your choosing.   

Additional command line info can be added using /cmd; the Command function (or is it a variable) can be used to retrieve the information following /cmd.

Naturally, /cmd is the last parsable item on the command line.

RE: Run MS Access Macro using Task Scheduler

Alternative (if possible): rename your macro to AutoExec and you don't need the /x switch.

However, this restricts you to one macro. /x MacroName is more flexible...

Good luck

Daniel Vlas
Systems Consultant

RE: Run MS Access Macro using Task Scheduler

For whatever reason I am still not able to get this to work. I am using Windows 2000 and I am logged on as as user with Administrator rights.

Using task scheduler I am trying to launch a macro called "mcrTestMacro" located in MS Access mdb file "C:Test\Test.mdb". I am able to run the macro from within the mdb file (it simply emails a table to a yahoo email account in *.txt format).

However, I have tried several ways to set up task scheduler

1st using "D:\Program Files\Microsoft Office\Office\MSAccess.exe" in the "Start In" text box (note path is in quotes) and then placing "C:\Test\Test.mdb /x mcrTestMacro" in the "Run" text box within the first tab of the Task Scheduler (this path also in quotes)

It doesnt work. Then I tried putting the "[path to MSAccess.exe}" space "[path to Test.mdb file]" /x mcrTestMacro - NUTTIN WORKS.

I am probably missing something really simple. Help!

RE: Run MS Access Macro using Task Scheduler

I don't have access (no pun intended) to a task scheduler.

An alternative course of action:

1) Create and debug a .bat file
2) run that from the scheduler.

RE: Run MS Access Macro using Task Scheduler

Your StartIn textbox is correct but your syntax for the Run box is not correct.  Try this:
"D:\Program Files\Microsoft Office\Office\MSAccess.exe" "C:\Test\Test.mdb" /xmcrTestMacro

That should do it.


RE: Run MS Access Macro using Task Scheduler

P.S You need the path to the Access.exe file in the Run box as well as the path to the .mdb file so that line should all go in the Run Box.


RE: Run MS Access Macro using Task Scheduler

...with one space between access.exe path and file path.
And with one space between /x and mcrTestMacro

If you have only one version of Access on your computer, the short version (no path to msacces.exe) will also work:

"msaccess.exe " "C:\Test\Test.mdb /x mcrTestMacro"

Good luck,

Daniel Vlas
Systems Consultant

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close