I am working on a loop which functions as intended exceptfor the conditional expression and which keeps looping.
Ibelieve it maybe my method of assigning the conditional expressions “Do While TAIPlan = TAIPlan2”..” IfTAIPlan <> TAIPlan2 Then Exit Do”.
Basically I’m trying to compare one reference on say page 1 to same refpage two. If they’re the same then take a screen screen shot, otherwise exitloop.
At the moment this doesn’t recognize when they’re differentand never exits the loop.
Any help is appreciated!
Dim TAIReturn1 As Object
Dim TAIReturn2 As Object
Dim wsSheet As Worksheet
Dim TAIPlan As Object
Dim TAIPlan2 As Object
Set TAIReturn1 =MyScreen.Select(1, 1, 24, 80)
Application.GotoReference:="NewSP" ‘<-specified target cell
ActiveCell.FormulaR1C1 = TAIReturn1
'''Loop here to account forthe multiple sequence screens per search plan
Set TAIPlan =MyScreen.Select(2, 26, 2, 40) ‘<-Page one Ref
MyScreen.SendKeys ("<Enter>")
Set TAIPlan2 =MyScreen.Select(2, 26, 2, 40) ‘<- Page two Ref
Do While TAIPlan= TAIPlan2
Set TAIReturn2 =MyScreen.Select(8, 1, 24, 80)
Sheets("Stage").Select
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys ("{TAB}")
DoEvents
Application.Wait Now + TimeValue("00:00:02")
ActiveCell.FormulaR1C1 = TAIReturn2
MyScreen.SendKeys ("<Enter>")
SetTAIPlan2 = MyScreen.Select(2, 26, 2, 40) ‘<- New Page two Ref
IfTAIPlan <> TAIPlan2 Then Exit Do
Loop
Ibelieve it maybe my method of assigning the conditional expressions “Do While TAIPlan = TAIPlan2”..” IfTAIPlan <> TAIPlan2 Then Exit Do”.
Basically I’m trying to compare one reference on say page 1 to same refpage two. If they’re the same then take a screen screen shot, otherwise exitloop.
At the moment this doesn’t recognize when they’re differentand never exits the loop.
Any help is appreciated!
Dim TAIReturn1 As Object
Dim TAIReturn2 As Object
Dim wsSheet As Worksheet
Dim TAIPlan As Object
Dim TAIPlan2 As Object
Set TAIReturn1 =MyScreen.Select(1, 1, 24, 80)
Application.GotoReference:="NewSP" ‘<-specified target cell
ActiveCell.FormulaR1C1 = TAIReturn1
'''Loop here to account forthe multiple sequence screens per search plan
Set TAIPlan =MyScreen.Select(2, 26, 2, 40) ‘<-Page one Ref
MyScreen.SendKeys ("<Enter>")
Set TAIPlan2 =MyScreen.Select(2, 26, 2, 40) ‘<- Page two Ref
Do While TAIPlan= TAIPlan2
Set TAIReturn2 =MyScreen.Select(8, 1, 24, 80)
Sheets("Stage").Select
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys ("{TAB}")
DoEvents
Application.Wait Now + TimeValue("00:00:02")
ActiveCell.FormulaR1C1 = TAIReturn2
MyScreen.SendKeys ("<Enter>")
SetTAIPlan2 = MyScreen.Select(2, 26, 2, 40) ‘<- New Page two Ref
IfTAIPlan <> TAIPlan2 Then Exit Do
Loop