Take a look at it since its working now. Gar.
Code:
Call ConfirmIE(oie, "Fail", 500, 10)
Code:
Sub ConfirmIE(oie As InternetExplorer, TextNeeded As String, MSecs As Integer, MaxLoop As Integer)
LoopCt = 0
Do Until InStr(oie.document.body.innerText, TextNeeded) > 0
Call SleepIE(oie)
Call AppSleep(MSecs)
If LoopCt = MaxLoop Then GoTo ExitLoop
LoopCt = LoopCt + 1
Loop
GoTo Exit_Sub:
ExitLoop:
Call IEresp(oie, TextNeeded, MSecs, MaxLoop)
Exit_Sub:
End Sub
Code:
Sub IEresp(oie As InternetExplorer, TextNeeded As String, MSecs As Integer, MaxLoop As Integer)
Restart:
repl = InputBox("The webpage is not on the correct page, How would you like to proceed?" & vbCr & vbCr & "Please enter a number selection" & vbCr & _
"1 = End the Macro" & vbCr & "2 = Continue to wait for the page" & vbCr & "3 = Play a guessing game")
If repl = "1" Then
MsgBox ("Ended")
End
End If
If repl = "2" Then
valid = "Yes"
Call ConfirmIE(oie, TextNeeded, MSecs, MaxLoop)
End If
If repl = "3" Then
valid = "Yes"
MsgBox "ba da da daa da da da, yea I don't know"
End If
If valid <> "Yes" Then
MsgBox "Please select a valid response" & vbCr & "Examples are 1, 2, 3, etc, etc", vbCritical
GoTo Restart:
End If
End Sub
I plan on building out IEresp to be unique to each process, but it will be nice to have a standard format with everything moving forward.