Link to home
Start Free TrialLog in
Avatar of Maggi Soffa
Maggi SoffaFlag for Iceland

asked on

Run .vbs with Task scheduler

I am trying to run .vbs script who reads data from Excel. It works fine when I run it from command line but it does not work if I run it from Task Scheduler, but if I run it as Administrators  from Task scheduler it works. But the I can only save the task as "Run only when user is logged on"

User generated image
ASKER CERTIFIED SOLUTION
Avatar of zc2
zc2
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Maggi Soffa

ASKER

It has Set objExcel = CreateObject("Excel.Application")
There are no errors just stops but I can see in the Task Manager it opens Excel.
Try to use the Microsoft Sysinternals Process monitor tool to find out what events were failed.
IIRC Excel (as all Office) tasks require a GUI session, and if running "whether logged on ..." there is no such session.
Maybe you can restrict the task to work with a CSV file instead, which does not require Office Automation.
I need  Excel to make the CSV/TEXT file automaticly therefrom another program process it.
Excel (as all Office) tasks require a GUI session
Not exactly. Please see my first comment which contains an instruction how to make the Excel work without a GUI session.