I am trying to run a vbs script through Task Scheduler. The code for the vbs script is
Dim ObjExcel, ObjWB
Set ObjExcel = CreateObject("excel.application")
'vbs opens a file specified by the path below
Set ObjWB = ObjExcel.Workbooks.Open("FilePath\CombinePDFs.xlsm")
'either use the Workbook Open event (if macros are enabled), or Application.Run
ObjWB.Close False
ObjExcel.Quit
Set ObjExcel = Nothing
Then the Action in Task Scheduler is:
Program/Script: "FilePath\CombinePDFS.vbs"
With no added argument or "Start in." Trying to run this had caused it to run 20 minutes so far and it doesn't look like it's ever going to stop. It usually takes 1 minute to run.
I've read online that people say I need to be executing this in Cscript, but I have done no command coding and so I can't figure out where the CScript.exe file is supposed to go in the "Edit Action" box. Any clarification on where I need to put the Cscript.exe would be most helpful, or if you see another problem let me know.
Run only when user is logged in
selected on theGeneral
page of the task properties. – BondRun whether user is logged on or not
because I'll need it to run when my computer is logged off at night. It's also set to run with highest privileges. – hypetech