Solved

wait among sendkeys

Posted on 2004-08-04
6
275 Views
Last Modified: 2008-02-26
My code is as follows.. Please insert the wait after the sendkeys I have specified.. I have tried my level best but unable to get the results..

'**************************************

ReturnValue = Shell("myapplication.exe", 1)
AppActivate ReturnValue

Name1 = "Trial" & Number & ".prd"
Name2 = "Trial" & Number & ".csv"

SendKeys "%{s}" & "{right}" & "{right}" & "O", True
SendKeys Name1 & "{TAB}" & "{TAB}" & "{ENTER}", True

SendKeys "%{o}" & "R" & "D" & "{ENTER}", True

?????????????want to wait here for twelve seconds



SendKeys "%{F}~", True
SendKeys Name2 & "{enter}", True

?????????????want to wait here for twelve seconds

If wells <> 0 Then
SendKeys "{left}" & "{left}", True
SendKeys "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}", True

?????????????want to wait here for twelve seconds


For i = 1 To wells
   
SendKeys "{down}", True
SendKeys "%{F}~", True
SendKeys "w" & i & Name2 & "{enter}", True

?????????????want to wait here for twelve seconds


Next i

End If


SendKeys "%{F}" & "E" & "{enter}", True     ' closing application
SendKeys "%{f}" & "X", True
SendKeys "{ESCAPE}", True


Thank you.

0
Comment
Question by:Aiysha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11720907
Use WinApi Sleep function


Sleep 300 ' wait for 300 milliseconds
0
 

Author Comment

by:Aiysha
ID: 11721211
No, it didnt work... I guess there is no practical way of using waitcommand in sendkey mode.. This help me though..

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Controls/Q_20550601.html?query=sleep%2C+sendkey&clearTAFilter=true

Very dirty way, but it helped.. Sorry jaime_olivares.. but thanx for trying..


Moderator, Please delete this question.

Thank you.
0
 
LVL 22

Expert Comment

by:cookre
ID: 11721304
One presumes you did a Sleep 12000.

Note that Sleep stop the calling process.  It's not just a local idle loop - all message processing is stopped, too.  The linked example probably failed because he was send ing keys to himself and not an independent app.
0
 
LVL 3

Expert Comment

by:bigjim2000
ID: 11808341
Are you using .NET?

If so, then you can use the System.Windows.Forms.SendKeys.SendWait(string) method.  This sends the keys as normal, but also waits for the key messages to get processed before continuing.

-Eric
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12036235
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question