none
How to recognize open Rumba Mainframe session and send commands from excel VBA RRS feed

  • Question

  • Hi All,

    I want to recognize the open Rumba Mainframe display (AS400) and send commands from excel to Rumba. Can anyone give some basic information on how to start working on this, i learnt that there is a built in library "RUMBASCRIPTATLib" to do, tried couple of way to create object but always i get some error. Could anyone help in this regards?

    Regards,

    Naseem

    Wednesday, February 8, 2012 3:11 PM

Answers

  • Hi Naseem,

    No experience with Rumba, but it seems you need an API for this ehlapi32.dll.

    When referencing the DLL you can create Function to use it.

    Check also your documentation, or ask your supplier for it, for more info on how to reference it and which functions to use.

    See below example on how to declare these functions:

    'HLLAPI FUNCTION DECLARATIONS
    Private Declare Function WD_AdviseHostUpdate Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal hInstanceMsg As Integer, ByVal Msg As Integer) As Integer
    Private Declare Function WD_ConnectPS Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal ShortName As String) As Integer
    Private Declare Function WD_Convert Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal ConvertType As Integer, RowCol As RowCol, ByVal ShortName As String) As Integer
    Private Declare Function WD_CopyFieldToString Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Position As Integer, ByVal Buffer As String, ByVal Length As Integer) As Integer
    Private Declare Function WD_CopyOIA Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal OIAData As String, ByVal Length As Integer) As Integer
    Private Declare Function WD_CopyPS Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Buffer As String, ByVal Length As Integer) As Integer
    Private Declare Function WD_CopyPSToString Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Position As Integer, ByVal Buffer As String, ByVal Length As Integer) As Integer
    Private Declare Function WD_CopyStringToField Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Position As Integer, ByVal Buffer As String) As Integer
    Private Declare Function WD_CopyStringToPS Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Position As Integer, ByVal Buffer As String, ByVal Length As Integer) As Integer
    Private Declare Function WD_DeletePS Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal ShortName As String) As Integer
    Private Declare Function WD_DisconnectPS Lib "EhlApi32.dll" (ByVal hInstance As Integer) As Integer
    Private Declare Function WD_DisplayCursor Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Position As Integer, ByVal ShortName As String) As Integer
    Private Declare Function WD_DisplayPS Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal ShortName As String) As Integer
    Private Declare Function WD_FindFieldLength Lib "EhlApi32.dll" (ByVal hInstance As Integer, Length As Long, ByVal Position As Integer, ByVal FindData As String) As Integer
    Private Declare Function WD_FindFieldPosition Lib "EhlApi32.dll" (ByVal hInstance As Integer, Location As Integer, ByVal Position As Integer, ByVal FindData As String) As Integer
    Private Declare Function WD_GetKey Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal GetKeyData As String) As Integer
    Private Declare Function WD_GetSessionHWND Lib "EhlApi32.dll" (ByVal hInstance As Integer) As Integer
    Private Declare Function WD_Pause Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Length As Integer) As Integer
    Private Declare Function WD_PostInterceptStatus Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal ShortName As String) As Integer
    Private Declare Function WD_QueryCursorLocation Lib "EhlApi32.dll" (ByVal hInstance As Integer, Location As Integer) As Integer
    Private Declare Function WD_QueryFieldAttribute Lib "EhlApi32.dll" (ByVal hInstance As Integer, iAttribute As Integer, ByVal Position As Integer) As Integer
    Private Declare Function WD_QueryHostUpdate Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal ShortName As String) As Integer
    Private Declare Function WD_QuerySessionStatus Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal SessionData As String) As Integer
    Private Declare Function WD_QuerySystem Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal SystemData As String) As Integer
    Private Declare Function WD_ReceiveFile Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal TransferData As String) As Integer
    Private Declare Function WD_Release Lib "EhlApi32.dll" (ByVal hInstance As Integer) As Integer
    Private Declare Function WD_Reserve Lib "EhlApi32.dll" (ByVal hInstance As Integer) As Integer
    Private Declare Function WD_ResetSystem Lib "EhlApi32.dll" (ByVal hInstance As Integer) As Integer
    Private Declare Function WD_RunMacro Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Buffer As String) As Integer
    Private Declare Function WD_RunProfile Lib "EhlApi32.dll" (ByVal Profile As String, ByVal SW_Value As Integer) As Integer
    Private Declare Function WD_SearchField Lib "EhlApi32.dll" (ByVal hInstance As Integer, Location As Integer, ByVal Position As Integer, ByVal Buffer As String) As Integer
    Private Declare Function WD_SearchPS Lib "EhlApi32.dll" (ByVal hInstance As Integer, Location As Integer, ByVal Position As Integer, ByVal SearchData As String) As Integer
    Private Declare Function WD_SendFile Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal TransferData As String) As Integer
    
    'Private Declare Function WD_Sendkey Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal KeyData As String) As Integer
    Private Declare Function WD_Sendkey Lib "Eehllapi.dll" (ByVal hInstance As Integer, ByVal KeyData As String) As Integer
    
    Private Declare Function WD_SetCursor Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Position As Integer) As Integer
    Private Declare Function WD_SetSessionParameters Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal SSPData As Long) As Integer
    Private Declare Function WD_ShowSession Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal ShowWindow As Integer) As Integer
    Private Declare Function WD_StartHostNotification Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal NotifyData As String) As Integer
    Private Declare Function WD_StartKeystrokeIntercept Lib "EhlApi32.dll" Alias "WD_StartKSIntercept" (ByVal hInstance As Integer, ByVal SKIData As String) As Integer
    Private Declare Function WD_StopHostNotification Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal ShortName As String) As Integer
    Private Declare Function WD_StopKeystrokeIntercept Lib "EhlApi32.dll" Alias "WD_StopKSIntercept" (ByVal hInstance As Integer, ByVal ShortName As String) As Integer
    Private Declare Function WD_Wait Lib "EhlApi32.dll" (ByVal hInstance As Integer) As Integer

    Hope this helps,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"


    Saturday, February 11, 2012 2:29 PM
    Moderator