Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Task Scheduler Running a Macros

Status
Not open for further replies.

bdmoran

MIS
Nov 7, 2011
87
US
Hello,

So I have an ImportExport Text macro set up in an Access Database. I am trying to find the best way to run this automatically, once a day. From the research I've done over the past few days, it seems like people have been using the Task Scheduler to automatically open up an Access DB and run a macro. I have tried doing this but it will not work. I created a batch file -- Can someone please view my syntax below and see what is wrong?!

"C:\Msaccess.exe" "S:\DATA\AcsData.mdb/x MasterAccessToImport"

I placed the above batch file in "Program/Script" box of the Task Scheduler. It runs but nothing happens... My "Last Run Result" has a message of (0x1)

Any ideas or assitance would be greatly apprecaited !

Thank you
 
try

"C:\Msaccess.exe" "S:\DATA\AcsData.mdb" /x MasterAccessToImport

also check your Access location typically access is stored in another directory not just in the root something like

C:\Program Files\Microsoft Office\Office11 or a variation of

should work fine with the adjustments i update many dbs daily in the same manner

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Alright I tried your first suggestion and still nothing. I also tried this:

"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Msaccess.exe" "S:\DATA\AcsData.mdb" /x MasterAccessToImport

I feel like I tried both of these yesterday too, since I have been messing around with the syntax for a little bit now.

Quick question - When you update your db's with this method, do you typically create a batch file? Or do you just use the direct root?

Here are my steps as of now:

1. Create basic task
2. Action = Start a program
3. Program/scrip input box = Browse for my Batch File which is ("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Msaccess.exe" "S:\DATA\AcsData.mdb" /x MasterAccessToImport)
Add arguments = blank
Start in = blank

I feel like I'm very close...
 
I appreciate your help but I figured it out...

All I did was create a batch file using this path:

"S:\DATA\AcsData.mdb" /x MasterAccessToImport

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top