Macro from task scheduler

jrsl

Registered User.
Local time
Tomorrow, 05:40
Joined
Mar 25, 2009
Messages
26
I have a macro that i want to run every five minutes so i have made a scheduled task.

the string is:
"C:\Users\Justin\AppData\Local\VirtualStore\Program Files (x86)\PaperWRX\Data\pwEssentials.mdb - Shortcut" "/x ApendCustMacro"

Which runs perfect from the run (start menu) but i get errors from task scheduler.
"Action failed to start" ect

I have also tried:
"C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.EXE" "C:\Users\Justin\AppData\Local\VirtualStore\Program Files (x86)\PaperWRX\Data\pwEssentials.mdb - Shortcut" "/x ApendCustMacro"

with the same effect.

Any ideas?

Regards,
Justin
 
It suggested to use a .bat file with this code:

C:
CD\Program Files\Microsoft Office\Office
Msaccess.exe C:\Northwind.mdb /x Macro1

(related to mine of course)

It didn't work with access 2007 and vista, however i managed to use this code:


START MSACCESS.exe "C:\Users\Justin\AppData\Local\VirtualStore\Program Files (x86)\PaperWRX\Data\pwEssentials.mdb" /x ApendCustMacro

which runs fine as a batch file but dose not run from the task manager, it says it worked but i know the macro didnt run. After that if i try to open access database manualy it needs to open in safe mode.
Could this be something to do with privileges?

Cheers,
Justin
 
Try setting the 'Start in' option to -

"C:\Program Files\Microsoft Office\Office"
 
it wont run as a batch file like that.

The batch file runs fine when i double click it (previous way) but it wont run through scheduled tasks. it says it run fine but it never opened the database and my macro didnt run.

Justin
 
It may be a macro security issue.

I use use a VB Script to launch the database with the macro security set to low.

Example:
Code:
dim o
set o=createobject ("Access.Application")
o.automationsecurity=1 ' set macro security LOW.
o.opencurrentdatabase "c:\vbtest.mdb"
o.usercontrol=true
set o=nothing
 

Users who are viewing this thread

Back
Top Bottom