Skip to main content

Most of the code in my Legacy Extra! macro is working in Reflections Desktop version 16.2 but the following If statement gets a "Type mismatch occurred at line: 110".  Line 110 starts with the first If statement below.  Any ideas?  If I comment out this "If Not" statement and code it works.

'Handle problems with the QMEN status screen here.
AtACAPSScreen = Sess0.Screen.WaitForString("ACAPS Enterprise")

If Not AtACAPSScreen Then
ButtonPressed = MsgBox("I am not detecting that we are at the ACAPS Main Screen Yet. Do you want to continue to wait? Select OK to continue to wait or Cancel to quit", 33, "Continue?")
If ButtonPressed = 2 Then
Goto StopMacro
Else
Sess0.Screen.Sendkeys("<Enter>")

AtACAPSScreenYet = Sess0.Screen.WaitForString("ACAPS Enterprise")

If Not AtACAPSScreenYet Then
MsgBox"Navigation to ACAPS Main Screen Failed. Possibly try macro again later.", 0 64 0, "Macro Stopped."
GoTo StopMacro
End If
End If
End If

System.TimeoutValue = OldSystemTimeout

Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Home>")
Sess0.Screen.WaitHostQuiet(10)


#Reflection

Most of the code in my Legacy Extra! macro is working in Reflections Desktop version 16.2 but the following If statement gets a "Type mismatch occurred at line: 110".  Line 110 starts with the first If statement below.  Any ideas?  If I comment out this "If Not" statement and code it works.

'Handle problems with the QMEN status screen here.
AtACAPSScreen = Sess0.Screen.WaitForString("ACAPS Enterprise")

If Not AtACAPSScreen Then
ButtonPressed = MsgBox("I am not detecting that we are at the ACAPS Main Screen Yet. Do you want to continue to wait? Select OK to continue to wait or Cancel to quit", 33, "Continue?")
If ButtonPressed = 2 Then
Goto StopMacro
Else
Sess0.Screen.Sendkeys("<Enter>")

AtACAPSScreenYet = Sess0.Screen.WaitForString("ACAPS Enterprise")

If Not AtACAPSScreenYet Then
MsgBox"Navigation to ACAPS Main Screen Failed. Possibly try macro again later.", 0 64 0, "Macro Stopped."
GoTo StopMacro
End If
End If
End If

System.TimeoutValue = OldSystemTimeout

Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Home>")
Sess0.Screen.WaitHostQuiet(10)


#Reflection

Hi jcbolton,

This should work as you have it coded, but it looks like there is an difference for this specific statement with the Reflection version of the Extra Basic Runtime. I think you will be able to resolve it by specifically declaring AtACAPSScreenYet before using it:

Dim AtACAPSScreenYet As Integer AtACAPSScreenYet = Sess0.Screen.WaitForString("ACAPS Enterprise") If Not AtACAPSScreenYet Then

Let me know if that works for you.

Regards,

JeffB

 

 


Hi jcbolton,

This should work as you have it coded, but it looks like there is an difference for this specific statement with the Reflection version of the Extra Basic Runtime. I think you will be able to resolve it by specifically declaring AtACAPSScreenYet before using it:

Dim AtACAPSScreenYet As Integer AtACAPSScreenYet = Sess0.Screen.WaitForString("ACAPS Enterprise") If Not AtACAPSScreenYet Then

Let me know if that works for you.

Regards,

JeffB

 

 

Yes, this did work for me.  Thank you for responding.