Venio
asked on
Delay an application
Hi!
I need to remote SAP by using the sendkey command. Since SAP needs some time to get the specified data - I need to create a pause before I can continue sending the other keys... Can you tell me how I can do that? I don't think it's difficult but I just don't get it at the moment...
I need to remote SAP by using the sendkey command. Since SAP needs some time to get the specified data - I need to create a pause before I can continue sending the other keys... Can you tell me how I can do that? I don't think it's difficult but I just don't get it at the moment...
ASKER
I've tried sleep before but it didn't work... I have added the Source Code... maybe I've done something wrong (I'm totally new to VB)
Private Sub Command2_Click()
Dim i, j As Long
SendKeys "%{tab}"
For i = 0 To (List1.ListCount - 1)
SendKeys "{Tab}"
SendKeys "{Tab}"
SendKeys List1.List(i)
SendKeys "{F8}"
Sleep (1000)
SendKeys "~"
SendKeys "^(+{F7})"
Next
End Sub
Private Sub Command2_Click()
Dim i, j As Long
SendKeys "%{tab}"
For i = 0 To (List1.ListCount - 1)
SendKeys "{Tab}"
SendKeys "{Tab}"
SendKeys List1.List(i)
SendKeys "{F8}"
Sleep (1000)
SendKeys "~"
SendKeys "^(+{F7})"
Next
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
das hat mir geholfen! Vielen Dank!
Sie sind willkommen.
ASKER
;-) now it's out: I'm from Germany...
There is an api call which is best suited to this task:
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Then when you want to wait:
Sleep 5000 'Wait for 5 seconds
Tim Cottee MCSD, MCDBA, CPIM
http://www.timcottee.tk
Brainbench MVP for Visual Basic
http://www.brainbench.com
Experts-Exchange Advisory Board Member