Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

Join Tek-Tips
*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.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

mischief911 (TechnicalUser) (OP)
17 Mar 03 15:33
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!
beetee (Programmer)
17 Mar 03 16:29
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.
danvlas (Programmer)
18 Mar 03 2:15
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

mischief911 (TechnicalUser) (OP)
18 Mar 03 13:13
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!
beetee (Programmer)
18 Mar 03 13:35
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.
PaulBricker (Programmer)
18 Mar 03 13:38
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.

Paul
PaulBricker (Programmer)
18 Mar 03 13:40
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.

Paul
danvlas (Programmer)
19 Mar 03 2:26
...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

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!

Back To Forum

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