cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Command to put a Wait/Sleep in Macro VB Script.

mogenkp
Super Contributor

I need to put a Hopex macro on a Windows Task Scheduler.

The macro queries Hopex and outputs the results to a MS-Excel file.

I have an external script written already that calls the Hopex Macro objext and executes fine while I'm logged in. It won't work from the Task Scheduler. My thought is the Hopex process and Windows shell is  is terminating before Excel has finished writing the output file.

 

I've added Wscript.Sleep in my external script, but it did not help.

My thought now is to put a a pause within the Hopex Macro script. Unfortunetly, "Wscript.Sleep" is not a proper method.

 

Suggestions?    Anyone else have this issue and come to some resolution?

1 Reply

oguimard
Retired

There is no need to put any wait or sleep. It should work.

 

Most likely your script has an issue or the way the windows user is defined on the taks scheduler is not correct.