

The IBM sample does this by creating a new session and then assigning it the demo Host/IP address. Loop While Len(WorksheetFunction.Trim(rowText)) > 0įirst, the sample creates an InfoConnectsession. 'Remove spaces and check for an empty row 'Using the row, column, and length values from a recorded macro RowText = WorksheetFunction.Trim(rowText) 'Get data as long as the row on the screen is not emptyĭo 'Remove lines between columns and remove extra spaces 'column, and length values from a recorded macro 'Start on row 5 and get the first row of text using the row, Screen.SendControlKey ControlKe圜ode_Return 'wait after keys are sent to make sure host screen is ready before sending more keys

Set terminal = app.CreateControl( Environ$( "USERPROFILE") & "\Documents\Micro Focus\InfoConnect\" & "GetData.rdox")įrame.Visible = True 'Send keys to navigate to screen that contains data 'Declare additional InfoConnect objects required to create and display a sessionĭim screen As Attachmate_Reflection_Objects_Emulation_OpenSystems.screenĭim terminal As Attachmate_Reflection_Objects_Emulation_OpenSystems.terminalĭim rCode As Integer Dim path As String Dim rowText As String Dim row As Integer, col As Integer Dim rowFromHost() As String Const NEVER_TIME_OUT = 0 'Declare an object variable for the InfoConnect object: 'Check string length after removing all extra spaces 'Write each column in the row to the spreadsheetĬells(row, (col + 5)).Value = rowFromHost(col) RowFromHost(col) = Replace(rowFromHost(col), "_", " ", 1, 1) 'Replace delimiter that was added for compound words RowText = (rowText)įor col = LBound(rowFromHost) To UBound(rowFromHost) 'Gather data until an empty row is encounteredĭo 'Replace spaces between compound words in first column and remove extra spaces RCode = screen.SendControlKey(ControlKe圜ode_Transmit)Įnd If If screenID3 = "INTERNATIONAL" Then 'Start on row 7 and get the first row of text from the screen ScreenID3 = screen.GetText(1, 25, 13) 'option 2 ScreenID2 = screen.GetText(1, 7, 4) 'option 2 ScreenID1 = screen.GetText(1, 2, 6) 'ATM VM ispf Terminal.HostAddress = "demo:ibm3270.sim" Set view = frame.CreateView(terminal)Įnd Sub Private Sub screen_NewScreenReady( ByVal sender As Variant)ĭim screenID1 As String, screenID2 As String, screenID3 As String Dim rCode As ReturnCodeĭim rowText As String Dim rowFromHost() As String Dim col As Integer, row As Integer Loop 'Create controls to open and display the session document.įrame.Visible = True Set terminal = app.CreateControl2( "09E5A1B4-0BA6-4546-A27D-FE4762B7ACE1") Set app = New Attachmate_Reflection_Objects_Framework.ApplicationObject 'Declare additional InfoConnect objects, such as frame, terminal, and viewĭim frame As Attachmate_Reflection_ameĭim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminalĭim view As Attachmate_Reflection_Objects.view 'Declare an object variable for the InfoConnect objectĭim app As Attachmate_Reflection_Objects_Framework.ApplicationObject Public WithEvents screen As Attachmate_Reflection_Objects_Emulation_IbmHosts.ibmScreen
