How to run a macro at a set time each day?

  • Thread starter Thread starter Marty
  • Start date Start date
M

Marty

I have a tab delimited text file that I need to import
into a Access DB each day at around 12 midnight to 2AM in
the morning. I would like to automate this process, I can
handle the code for the import itself but I need help
figuring how to get the code to run by itself with no user
action. If you have any ideas please let me know. Thanks
for any thoughts!
 
Leaving the application running is unnecessary.

1. Create a macro that will run the code importing the text file. The
macro should also quit/close Access when it is done.
2. Create a scheduled task in Windows that executes at the desired time.
Use the following command line:
"path to msaccess.exe" "path to your.mdb" /x macronamehere

The task should be run under an account having permissions necessary to
access network resources (if any of the files are located somewhere besides
local machine).

Also, the macro could be named autoexec, and if it is, you do not need the
/x macronamehere on your command line.
 
Back
Top