8/26/2016 3:54 PM | |
Posts: 5 Rating: (1) |
I have found the solution to the problem: WScript.Sleep only works in the Windows Script Host environment (Source). My solution is to instead use a workaround with a Timer object: Sub Delay3Seconds Dim pastTime, currTime pastTime = Timer currTime = Timer Do While currTime - pastTime < 3 currTime = Timer Loop End Sub I have tested this with Notepad; I will update this post when I have tested with WinCC. Feel free to add alternative solutions, since my code is a bit clunky. Update: It worked! The time delay can be decreased to 1 second. The issue was just that using WScript.Sleep was causing a runtime error. |
Last edited by: Indalco1 at: 8/29/2016 2:27:58 PM |
|
Follow us on