Link to home
Start Free TrialLog in
Avatar of Roman F
Roman FFlag for United States of America

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Roman F

ASKER

thank you
i have never done it before, how?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or do you need to know how to create a .bat?
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



Avatar of Roman F

ASKER

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

 /X    ' run Macro

RunReport   ' < name of macro to run
Avatar of Roman F

ASKER

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


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

post another question/s...
Avatar of Roman F

ASKER

capricorn1:
but this questions are part of the original question...
leave your computer ON, while your Logged in...  
Avatar of Roman F

ASKER

the computer lock itself every 15 minutes and  nobody can change the time, company policy...
we dedicate a computer for this purposes, it just run without interruption...
Avatar of Roman F

ASKER

So, it means it is impossible in my case
It can be done with Wake on LAN:

http://en.wikipedia.org/wiki/Wake-on-LAN
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Roman F

ASKER

"C:\Documents and Settings\....mdb" /Excl /X RunReport
should be in "RunReport"