I'm trying to automate some Attachmate Extra! with VBA. How do I press Page Down on the reflection?

1k Views Asked by At

So I have to automate a task for the company I'm in, and it involves Attachmate Reflection Extra! (.edp)

I've been trying to press the key Page Down with no sucess. Not with sendcontrolkey, not with "RollUp", not with "PageDown", "PGDN", nothing works. How can I press PageDown on Attachmate Extra?

       strPag = Trim(ExtraEcran1.getstring(13, 2, 8))
            ExtraEcran1.SendKeys "<RollUp>"
        qtdPag = qtdPag + 1

        Do While strPag <> Trim(ExtraEcran1.getstring(13, 2, 8)) And i < 5
            strPag = Trim(ExtraEcran1.getstring(13, 2, 8))
            i = i + 1
            qtdPag = qtdPag + 1
            ExtraEcran1.SendKeys "<PAGEDOWN>"
        Loop

This is a recorded macro from Attachmate Extra!, which didn't work for me

Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim returnValue As Integer


Const NEVER_TIME_OUT = 0

Dim ESC As String   ' Chr(rcESC) = Chr(27) = Control-[

Set osCurrentTerminal = ThisFrame.SelectedView.Control
Set osCurrentScreen = osCurrentTerminal.Screen

ESC = Chr(27)

' Press VtNextScreen (Executar a função Próxima tela).
Call osCurrentScreen.SendControlKey(ControlKeyCode_NextScreen)
'Wait for a string on the host screen before continuing
returnValue = osCurrentScreen.WaitForString3(ESC & ">", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes)
If (returnValue <> ReturnCode_Success) Then
    Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001"
End If

Also, here are the codes of extra sendkeys https://docs.attachmate.com/extra/x-treme/apis/com/5250functionkeys_des.htm

I

Edit: couldn't get it to work in any way. Decide to, instead, go with a lot of down keys.

0

There are 0 best solutions below