Passing data from the screen to Excel

The following example launches Rumba+, opens a session, connects, then reads data from the screen and sets it to a range of cells in an Excel sheet:
Dim App As RumbaApplicationObject
Dim Emul As RumbaEmulationSessionObject
Dim ReflectionSession As ReflectionLegacySession
Dim SessID As Integer
  
Sub RunRumbaAndGetData()
    Set App = CreateObject("MicroFocus.Rumba")
    SessID = App.CreateSession(RumbaSessionType_MainFrameDisplay)
    Set Emul = App.GetSession(SessID)
    Emul.HostName = "csimvs"
    Emul.Port = 23
    Set ReflectionSession = CreateReflectionLegacySession(Emul, App)
    ReflectionSession.Connect
    
    ' Get data from the emulation screen to the Excel cells
    ReflectionSession.WaitForDisplayString "Application", "10", 3, 2
    GetData
End Sub

Sub GetData()
    Set Durations = Range("A1:A3")
    For i = 1 To 3
        DataText = ReflectionSession.GetDisplayText(i + 4, 10, 7)
        Set Duration = Durations.Cells(i, 1)
        Duration.Value = DataText
    Next
End Sub