ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   WaitForString Mutiple Conditions (https://www.excelbanter.com/excel-programming/439887-waitforstring-mutiple-conditions.html)

stickandrock

WaitForString Mutiple Conditions
 
I have a macro that is opening an Attachmate Emulator session to access host
data.

I am having a delay issue with some customers because I am trying to capture
data(using getstring commands) from the the emulator before it has returned
it values.

I can test a message area on the screen and if it is greater than "" I can
assume the screen has returned. With the WaitForString command can I check
for "" verses an exact match on a string. The message area may say
"Complete" or "Error Code - xxx", that is why I need a generic check.

Sample Code:

myscreen.SendKeys ("<CLEAR")
myscreen.SendKeys ("/for OSINQ<ENTER")
myscreen.SendKeys ("<Pf10")
myscreen.SendKeys (SoldTo & "<ENTER")
DlrNm = myscreen.getstring(6, 9, 36)

before DlrNm is assigned I need to put a wait in there. I have code to wait
a hard number of seconds, but each user experiences a different delay and I
want to make something that is a bit more dynamic.

Thanks,


joel[_715_]

WaitForString Mutiple Conditions
 

Have you tried setting the Wait parameter to true?

myscreen.SendKeys ("<CLEAR", wait:=true)


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=181944

Microsoft Office Help



All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com