Solved

How to run macro automatically

Posted on 2011-09-07
17
674 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
  • 3
17 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 334 total points
ID: 36498761
create a .bat file and use Task Scheduler to set the schedule
0
 

Author Comment

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

Assisted Solution

by:Bryan Butler
Bryan Butler earned 166 total points
ID: 36498799
0
Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

 
LVL 16

Expert Comment

by:Bryan Butler
ID: 36498801
Or do you need to know how to create a .bat?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498809
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
ID: 36498893
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498927
/Excl  '< to open the db in exclusive mode

 /X    ' run Macro

RunReport   ' < name of macro to run
0
 

Author Comment

by:rfedorov
ID: 36498957
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498975


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

post another question/s...
0
 

Author Comment

by:rfedorov
ID: 36499006
capricorn1:
but this questions are part of the original question...
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36499126
leave your computer ON, while your Logged in...  
0
 

Author Comment

by:rfedorov
ID: 36499143
the computer lock itself every 15 minutes and  nobody can change the time, company policy...
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36499161
we dedicate a computer for this purposes, it just run without interruption...
0
 

Author Comment

by:rfedorov
ID: 36499190
So, it means it is impossible in my case
0
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 36499246
It can be done with Wake on LAN:

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

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 334 total points
ID: 36499401
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
ID: 36499463
"C:\Documents and Settings\....mdb" /Excl /X RunReport
should be in "RunReport"
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

623 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