blckngldhwk
Technical User
Code:
Sub Main()
Dim System As Object, Sess As Object, MyScreen As Object
Set System = CreateObject("EXTRA.System")
Set Sess = System.ActiveSession
Set MyScreen = Sess.Screen
varA = MyScreen.getstring(40,11,03)
varB = MyScreen.getstring(39,06,05)
varC = MyScreen.getstring(39,11,04)
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate "[internal address removed for privacy]"
objIE.Visible = True
objIE.Document.All("txtvarA").Value = varA
objIE.Document.All("txtvarB").Value = varB
objIE.Document.All("txtvarC").Value = varC
objIE.Document.All("btnsearchnow").Click
End Sub
The above code works great if I step through it but I am having a timing issue when I run it live. The issue is between the 'objIE.Visible = True' and 'VarA' lines of code. The code is trying step to the 'VarA' line when the page has not 'refreshed' yet so I get an error. It's only a split second that it's off but it's off. I have tried a 'while busy' command, 'waitfortimer' to no avail. How can I tell the code to wait until the page is loaded to move on?
Thanks!