[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 888
  • Last Modified:

Macro "running" in Task Scheduler

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
Microbomb
Asked:
Microbomb
  • 2
  • 2
1 Solution
 
Jeff_MarshCommented:
Hey Microbomb,

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

\|/ Jeff \|/
0
 
MicrobombAuthor Commented:
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
 
Jeff_MarshCommented:
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
 
rockiroadsCommented:
have u tried

application.Quit

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

0
 
MicrobombAuthor Commented:
Running it from the batch file seems to work. Strange that would do it. Thanks Jeff. You are manxx.
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now