Solved

How to run macro automatically

Posted on 2011-09-07
17
625 Views
Last Modified: 2012-05-12
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?
0
Comment
Question by:rfedorov
  • 7
  • 7
  • 3
17 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 334 total points
Comment Utility
create a .bat file and use Task Scheduler to set the schedule
0
 

Author Comment

by:rfedorov
Comment Utility
thank you
i have never done it before, how?
0
 
LVL 16

Assisted Solution

by:Bryan Butler
Bryan Butler earned 166 total points
Comment Utility
0
 
LVL 16

Expert Comment

by:Bryan Butler
Comment Utility
Or do you need to know how to create a .bat?
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
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
 

Author Comment

by:rfedorov
Comment Utility
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
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
/Excl  '< to open the db in exclusive mode

 /X    ' run Macro

RunReport   ' < name of macro to run
0
 

Author Comment

by:rfedorov
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility


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

post another question/s...
0
 

Author Comment

by:rfedorov
Comment Utility
capricorn1:
but this questions are part of the original question...
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
leave your computer ON, while your Logged in...  
0
 

Author Comment

by:rfedorov
Comment Utility
the computer lock itself every 15 minutes and  nobody can change the time, company policy...
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
we dedicate a computer for this purposes, it just run without interruption...
0
 

Author Comment

by:rfedorov
Comment Utility
So, it means it is impossible in my case
0
 
LVL 16

Expert Comment

by:Bryan Butler
Comment Utility
It can be done with Wake on LAN:

http://en.wikipedia.org/wiki/Wake-on-LAN
0
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 334 total points
Comment Utility
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
 

Author Comment

by:rfedorov
Comment Utility
"C:\Documents and Settings\....mdb" /Excl /X RunReport
should be in "RunReport"
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now