I have a program that sends keystrokes to another program but the program runs too fast. I need to put a 5 second delay after each sendkeys to give the other program time to process it. is there any easy way to do this?
What you want to do is add a Timer control to your form. Write a Sub like this:<br><br><br> Sub Wait(second as single)<br><br> Dim Starttime as Single<br><br> Starttime = Timer<br> <br> Do While Timer < Starttime + Second<br> DoEvents (optional)<br><br> Loop<br><br> End Sub<br><br> Now do a Call Wait (seconds) i.e. Call Wait (4) - Wait four seconds. Whatever you assign the seconds variable is how many seconds the program will wait before it continues to execute.<br><br> Hope this helps<br> <br> John Stephens<br><br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.