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:
Thanks in advance,
Haerion
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