Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
mm mm is offline
external usenet poster
 
Posts: 37
Default sendkeys(keys,wait) how do I use wait

How do I use the "Wait" when using Application.SendKeys
Example - Application.SendKeys("123456789",wait)
I need to have Excel wait for the keys to be processed before returning
control to the macro

--
MM
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default sendkeys(keys,wait) how do I use wait

Wait is not reliable. I use:

Sub PutValueIn()
Range("B2").Select
Application.SendKeys "abcd"
Application.SendKeys "{ENTER}"
DoEvents
' more stuff
End Sub

the DoEvents gives focus to the worksheet to handle the "keystrokes"

For an example of using SendKeys to communicate with another app:

http://msdn.microsoft.com/en-us/library/aa266281.aspx
--
Gary''s Student - gsnu200832


"MM" wrote:

How do I use the "Wait" when using Application.SendKeys
Example - Application.SendKeys("123456789",wait)
I need to have Excel wait for the keys to be processed before returning
control to the macro

--
MM

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wait function in Excel 2000 Macro fryb53 Excel Discussion (Misc queries) 3 January 16th 08 02:49 PM
Should I Wait? Chaplain Doug Excel Discussion (Misc queries) 0 February 6th 07 04:58 PM
Processing...Please Wait Message Box Connie Excel Discussion (Misc queries) 3 October 19th 06 10:54 PM
When Excel wait for OLE action allow cancel so not have to end pr sferrell615 Excel Discussion (Misc queries) 0 August 4th 06 02:46 PM
Wait for user to change data after msgbox ???? CanadianTrev Excel Discussion (Misc queries) 1 June 18th 05 08:27 PM


All times are GMT +1. The time now is 04:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"