'----------------------------------------------------------------------
' This macro was created by the macro recorder.
' Macro File: 
' Date: Wed Nov 06 07:07:48 2013
' Recorded for profile: Default 3270
'----------------------------------------------------------------------

Sub Main
  Dim HostExplorer as Object
  Dim MyHost as Object
  Dim Rc as Integer

  Dim iPSUpdateTimeout

  On Error goto GenericErrorHandler

  Set HostExplorer = CreateObject("HostExplorer") ' Initialize HostExplorer Object
  Set MyHost = HostExplorer.HostFromProfile("Default 3270") ' Set object for the desired session
  If MyHost is Nothing Then Goto NoSession

  iPSUpdateTimeout = 60       ' WaitPSUpdated timeout set to 60 seconds

    Dim wb As Workbook

  
  Workbooks.Open "C:\Users\abisvu1z\Desktop\export.xlsx"
  
  Exit Sub

'-------------------- Runtime Error Handlers --------------------
GenericErrorHandler:
  Msgbox "Error " & Err & " : """ & Error(Err) & """ has occurred on line " & Erl-1 & "." & Chr(10) & "Unable to continue macro execution.", 16, "HostExplorer Basic Macro Error"
  Exit Sub

NoSession:
  Msgbox "Profile ""Default 3270"" is not running." & Chr(10) & "Unable to execute macro.", 16, "HostExplorer Macro Error"
  Exit Sub

OnWaitPSUpdatedTimeout:
  Msgbox "Timeout occured waiting for host to update screen." & Chr(10) & "Unable to continue macro execution.", 16, "HostExplorer Basic Macro Error"
  Exit Sub

OnKeyboardError:
  Msgbox "Unable to type string on host screen." & Chr(10) & "Unable to continue macro execution.", 16, "HostExplorer Basic Macro Error"
  Exit Sub

End Sub
