Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wait on connection to continue macro

Status
Not open for further replies.

haerion

IS-IT--Management
Sep 13, 2006
130
US
Hi all,

Here is my problem:

I got a NITERM32 (terminal base program) that I need to open from my form. Once it is open, I need to open a connection, then enter my user/password. If I use wait in the macro it work 50% of the time with a 6s wait. The problem is sometime the connection is REALLY fast, like 1 sec, but other time it can take up to 10 sec or more to open. So I need something that could replace the wait command.

Also, the name of the application change like this:

"not connected - NITerm" : when program just opened
"connecting to Versys:1 - NITerm" : After the connection is selected
"Versys:1 -NITerm": when the connection is done

I need to enter the login when the window name is "Versys:1 - NITerm"

My actual code look like this:
Code:
'versys:1
Call Shell(Versys, vbNormalNoFocus)
AppActivate ("not connected - NITerm")
Wait 6

SendKeys "%f", True
SendKeys "1", True
'AppActivate ("Versys:1 - NITerm"), True <----- not working
Wait 1
SendKeys User & "{ENTER}", True
Wait 0.5
SendKeys Password & "{ENTER 2}", True
Wait 0.5
SendKeys "9" & "{ENTER}" & "3" & "{ENTER}", True
SendKeys "1" & "{ENTER}" & "1" & "{ENTER}" & "20" & "{ENTER}", True

Thanks in advance,

Haerion
 
Is it that no one have an idea on how to do that or just that I need to explain it better?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top