Solved

Macro "running" in Task Scheduler

Posted on 2004-04-06
5
874 Views
Last Modified: 2008-03-10
I have Windows Task Scheduler running a macro in Access that runs a couple querys and exports a csv file. It works perfect but the task scheduler says the task is still running and indeed Access stays open after the macro is done. How can I get it to close Access when the macro is done. I tried putting a close macro at the end of the macro but it doesnt work. Thanks.
0
Comment
Question by:Microbomb
  • 2
  • 2
5 Comments
 

Expert Comment

by:Jeff_Marsh
ID: 10769268
Hey Microbomb,

Try putting the "Quit" action as the last action in the macro!

\|/ Jeff \|/
0
 

Author Comment

by:Microbomb
ID: 10769441
Close, that closes the Access but the Scheduler Service still says "running" and looking under Task Manager I see that MSAcces.exe is still running, even though I don't see it. I click end task and the "running" status goes away.
0
 

Accepted Solution

by:
Jeff_Marsh earned 125 total points
ID: 10769505
Hmmmm - have you tried putting the command in a batch file and scheduling the batch file instead:

runit.bat:
@echo off
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "database.mdb" /x Macro.Name

\|/ JRM \|/
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10769653
have u tried

application.Quit

there is DoCmd.Close but I think that still leaves access with no db open, still running

0
 

Author Comment

by:Microbomb
ID: 10769778
Running it from the batch file seems to work. Strange that would do it. Thanks Jeff. You are manxx.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Top 1 of each supplier 55 60
Using Multiple  Filters (XLS and XLSX) in File selection dialog 6 34
Need help constructing a conditional update query 16 48
Switch 5 18
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

821 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