Add delays in VBscript or Python coding


You want a short delay between executing actions or scripts in Automation or PowerForms, but there is no direct command to execute the delay in VBscript or Python.


Use the following code:

  • In VBscript:

    Dim dteWait 
    dteWait = DateAdd("s", 5.0, Now()) ' change the middle value for different number of seconds 
    Do Until (Now() > dteWait) 
  • In Python:

    import time 
    time.sleep(5) # delay = 5 seconds