How to run macro automatically

Hi
I have MS Access 2003 or 2010. I am running macro, which has about 5 queries.
It takes long time to run, sometimes 7 hours.
The macro name is “RunReport”
I would like to run the macro automatically, let say every Sunday at 17: 00 PM
What should I do?
rfedorovAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
create a .bat file and use Task Scheduler to set the schedule
0
 
rfedorovAuthor Commented:
thank you
i have never done it before, how?
0
 
Bryan ButlerConnect With a Mentor Commented:
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
Bryan ButlerCommented:
Or do you need to know how to create a .bat?
0
 
Rey Obrero (Capricorn1)Commented:
for A2003


open notepad and enter codes like this

@echo off
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" "C:\FolderName\DatabaseName.mdb" /Excl /X RunReport


save it with a .bat extension

open Task Scheduler

Control Panel > Admistrative Tools > Task Scheduler


follow the wizard



0
 
rfedorovAuthor Commented:
capricorn1: thank you
"C:\Documents and Settings\....mdb" /Excl /X RunReport
what is
/Excl /X RunReport
I am not sure about  /Excl /X  part
0
 
Rey Obrero (Capricorn1)Commented:
/Excl  '< to open the db in exclusive mode

 /X    ' run Macro

RunReport   ' < name of macro to run
0
 
rfedorovAuthor Commented:
Ok, two questions:
1.  the computer will be locked because it is weekend, how to wake it up
2. I need to use password to connect the database to the server, few tables from the database located on the server
0
 
Rey Obrero (Capricorn1)Commented:


pls don't try to find all the answer to your problems in one thread...

post another question/s...
0
 
rfedorovAuthor Commented:
capricorn1:
but this questions are part of the original question...
0
 
Rey Obrero (Capricorn1)Commented:
leave your computer ON, while your Logged in...  
0
 
rfedorovAuthor Commented:
the computer lock itself every 15 minutes and  nobody can change the time, company policy...
0
 
Rey Obrero (Capricorn1)Commented:
we dedicate a computer for this purposes, it just run without interruption...
0
 
rfedorovAuthor Commented:
So, it means it is impossible in my case
0
 
Bryan ButlerCommented:
It can be done with Wake on LAN:

http://en.wikipedia.org/wiki/Wake-on-LAN
0
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
rfedorov,

open your Task Scheduler
Add new task
in the window that will open, there are Tabs and options that you can select

try to investigate them..
you will find that there is an option
* to Wake computer,
* run whether user is logged on or not

* etc....
0
 
rfedorovAuthor Commented:
"C:\Documents and Settings\....mdb" /Excl /X RunReport
should be in "RunReport"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.