Hello Dear Experts,
I am trying to get connection to Attachmate Extra (mainframe) in order to send some key strokes.
However, there seems to be missing some detail in a setup as I get Run-Time Error 5 saying "Invalid Procedure Call or Argument"
Does have anyone any idea what is missing in the below macro so that the connection can be made?
In addition to the procedure, I have References ticked out:
- Microsoft Visual Basic for Applications
- Microsoft Excel 14.0 Object Library
- Ole Automation
- Microsoft Office 14.0 Object Library
Here is the code I am using
Sub test() Dim System As Object
Dim Session As Object
Dim Screen As Object
On Error GoTo Err_h:
Set System = CreateObject("Extra.System")
If System Is Nothing Then Err.Raise 99999, "test sub", "Could not create Extra system object."
Set Session = System.ActiveSession
If Session Is Nothing Then Err.Raise 99999, "test sub", "Extra has not been launched. Please start the application."
Set Screen = Session.Screen
With Screen
.Putstring "CRO", 1, 4
.WaitHostQuiet (milliseconds)
.SendKeys ("")
End With
Clean_Exit:
Set Screen = Nothing
Set Session = Nothing
Set System = Nothing
Exit Sub
Err_h:
If Err.Number <> 0 Then
MsgBox "Error " & Err.Number & Chr(10) & Err.Description & Chr(10), vbCritical, "Error"
End If
GoTo Clean_Exit
End Sub
Thank you for any directions in solving the problem
Regards
Tommeck37
I am trying to get connection to Attachmate Extra (mainframe) in order to send some key strokes.
However, there seems to be missing some detail in a setup as I get Run-Time Error 5 saying "Invalid Procedure Call or Argument"
Does have anyone any idea what is missing in the below macro so that the connection can be made?
In addition to the procedure, I have References ticked out:
- Microsoft Visual Basic for Applications
- Microsoft Excel 14.0 Object Library
- Ole Automation
- Microsoft Office 14.0 Object Library
Here is the code I am using
Sub test() Dim System As Object
Dim Session As Object
Dim Screen As Object
On Error GoTo Err_h:
Set System = CreateObject("Extra.System")
If System Is Nothing Then Err.Raise 99999, "test sub", "Could not create Extra system object."
Set Session = System.ActiveSession
If Session Is Nothing Then Err.Raise 99999, "test sub", "Extra has not been launched. Please start the application."
Set Screen = Session.Screen
With Screen
.Putstring "CRO", 1, 4
.WaitHostQuiet (milliseconds)
.SendKeys ("")
End With
Clean_Exit:
Set Screen = Nothing
Set Session = Nothing
Set System = Nothing
Exit Sub
Err_h:
If Err.Number <> 0 Then
MsgBox "Error " & Err.Number & Chr(10) & Err.Description & Chr(10), vbCritical, "Error"
End If
GoTo Clean_Exit
End Sub
Thank you for any directions in solving the problem
Regards
Tommeck37