Was struggling to get task manager working for printing a pdf Multiple instances of MSAccess were running, I closed them and then I could see the error message 'runmacro action was killed' Here is a script that I tried: Dim accessApp set accessApp = CreateObject("Access.Application") accessApp.OpenCurrentDatabase "C:\Program Files (x86)\UDD\UDDReports.accdb" accessApp.DoCmd.RunMacro "OOWListPost" 'here I get the run macro action canceled accessApp.CloseCurrentDatabase accessApp.Quit set accessApp = nothing Made a module to delete the old file Public Function KillOOWListPost() Kill "C:\Out of Work\OOWListPost.pdf" End Function then in task scheduler: Run: "C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" Arguments: "C:\Program Files (x86)\UDD\UDDReports.accdb" /x “OOWListPost” Start in: C:\Program Files (x86)\UDD\ (no quotes in 'Start in') A tip of the hat to: http://www.xpcdesign.com/2008/06/msaccess-the-runmacro-action-was-canceled/ Found that the argument to start the Macro did not work, so made an AUtoExec macro. Further issue was MSAccess was not closing after printing the pdf. So, in the AutoExec, I added: "QuitAccess" |
Home > StuffLearned >