Access Macro Scheduler

Access Macro Scheduler Average ratng: 4,8/5 5427 reviews

How to make the task scheduler run a MS Access macro in the background without opening the access file This thread is locked. You can follow the question or vote as helpful, but you cannot reply to this thread. Download corel x4. Running MS Access macro with task scheduler. By NightFire. On Jun 26, 2014 at 14:12 UTC. Microsoft Office. The macro does run but Access hangs and does not. Application.Quit as last expression to be executed within the macro (or running code). As for the confirmation that the scheduled process was ended, it seems that it comes from the Task Scheduler. I believe you must select 'Run only when user is logged on' in your Windows Task Scheduler Job Properties. You must also be logged on to automatically have scheduled Access macros run. This really seems like a huge limitation of Access, but I have not seen another solution out there. I am trying to run an access DB macro every day at a set time using Windows 7 Task scheduler. Under 'actions- Program/script' in the task scheduler i put the following code to open Access 'C: Program Files (x86) Microsoft Office Office14 MSACCESS.EXE' This is successful. You can use a MS Access command line switch to run a macro. If you search for 'commandline' in Access help, the topic 'Startup command-line options' gives you all the commandline switches. The switch for running a macro is x macro.

  1. Ms Access Task Scheduler
  2. Run Access Macro Task Scheduler
Active5 years, 10 months ago

I'd like to have a macro, called Macro1, for example, run every day at 9 AM. It works great on its own from the VB code editor in Access 2007 but I would like it to be able to execute automatically without access being open.

Please note that I don't want there to have to be any human intervention, it needs to be able to run automatically without someone opening Access to trigger autoexec or onload or something similar.

Is this at all possible?

alexcocoalexcoco
5,2125 gold badges22 silver badges37 bronze badges

Ms Access Task Scheduler

3 Answers

You can use a MS Access command line switch to run a macro. If you search for 'commandline' in Access help, the topic 'Startup command-line options' gives you all the commandline switches. The switch for running a macro is x macro.

So, if you write your macro to run whatever you want and have it exit Access when it finishes, you can then create a commandline that will do the trick and put it in a batch file that the Windows Task Scheduler can execute.

However, as I said in a comment above, if you are just running some queries, I'd say it makes more sense to bypass Access entirely and use DAO directly in a scheduled vbScript to execute the queries.

David-W-FentonDavid-W-Fenton
21.4k3 gold badges39 silver badges53 bronze badges

You can use Windows Task Scheduler and VBScript to run code or start Access.

Microscope

Run Access Macro Task Scheduler

FionnualaFionnuala
85.9k7 gold badges96 silver badges133 bronze badges

You must create vbscript to run your macro and create a batch file to schedule your vbscript.

  • vbscript code, save this as schedule.vbs file

    Dim accessApp
    set accessApp = createObject('Access.Application')accessApp.OpenCurrentDataBase('fullpathmsaccessdb')

    accessApp.Run 'Macroname',param1, param2,param3
    accessApp.Quit
    set accessApp = nothing

  • THEN create file.bat

    @echo off
    cscript schedule.vbs

and your ready to schedule it using the windows task scheduler http://www.thewindowsclub.com/how-to-schedule-batch-file-run-automatically-windows-7

hope this help :D

Access Macro Scheduler
noodlenoodle

Not the answer you're looking for? Browse other questions tagged ms-accessmacrosms-access-2007scheduled-tasks or ask your own question.