Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to run macro automatically

Posted on 2011-09-07
17
Medium Priority
?
679 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 1336 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 664 total points
ID: 36498799
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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 1336 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

661 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