oliverrice
Programmer
Hi,
After weeks of searching, I have finally cracked the automation of a RUMBA mainframe using VBA. For those who need assistance with the basics, the declarations below work great:
Public Declare Function WD_ConnectPS Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal NameSpace As String) As Integer
Public Declare Function WD_SendKey Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal KeyData As String) As Integer
Public Declare Function WD_CopyPSToString Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal Position As Integer, ByVal HoldString As String, ByVal Length As Integer) As Integer
Public Declare Function WD_DisconnectPS Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long) As Integer
Public Declare Function WD_SetCursor Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal Position As Integer) As Integer
Public Declare Function WD_CopyOIA Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal CaptureStrng As String, ByVal Position As Integer) As Integer
Public Declare Function WD_SetSessionParameters Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal SessSetting As String) As Integer
Public Declare Function WD_StartHostNotification Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal PreDefStrng As String) As Integer
Public Declare Function WD_QueryHostUpdate Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long) As Integer
Public Declare Function WD_Wait Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long) As Integer
Public Declare Function WD_Pause Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal TimeLen As Long) As Integer
Once you have all these declarations in place, it is just a case of calling the function and then defining the call perameters required for each call i.e.:
RV = WD_SendKey(1, "HELLO")
The problem I have is that VBA will not wait for RUMBA to update the last function before it attempts the next one. This wouldnt be so bad if RUMBA would return an error from this but it doesnt. It just assumes that RUMBA has completed the task and carries on. I therefore need to work out how to use the Start Host Notification(23) function to enable me to use the PAUSE function. This will allow VBA to work out when RUMBA has updated from the previous call and then unlock VBA to send the next command.
Can anybody help?
Thanks,
Ollie
After weeks of searching, I have finally cracked the automation of a RUMBA mainframe using VBA. For those who need assistance with the basics, the declarations below work great:
Public Declare Function WD_ConnectPS Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal NameSpace As String) As Integer
Public Declare Function WD_SendKey Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal KeyData As String) As Integer
Public Declare Function WD_CopyPSToString Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal Position As Integer, ByVal HoldString As String, ByVal Length As Integer) As Integer
Public Declare Function WD_DisconnectPS Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long) As Integer
Public Declare Function WD_SetCursor Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal Position As Integer) As Integer
Public Declare Function WD_CopyOIA Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal CaptureStrng As String, ByVal Position As Integer) As Integer
Public Declare Function WD_SetSessionParameters Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal SessSetting As String) As Integer
Public Declare Function WD_StartHostNotification Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal PreDefStrng As String) As Integer
Public Declare Function WD_QueryHostUpdate Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long) As Integer
Public Declare Function WD_Wait Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long) As Integer
Public Declare Function WD_Pause Lib "C:\Program Files\NetManage\RUMBA 7.2\System\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal TimeLen As Long) As Integer
Once you have all these declarations in place, it is just a case of calling the function and then defining the call perameters required for each call i.e.:
RV = WD_SendKey(1, "HELLO")
The problem I have is that VBA will not wait for RUMBA to update the last function before it attempts the next one. This wouldnt be so bad if RUMBA would return an error from this but it doesnt. It just assumes that RUMBA has completed the task and carries on. I therefore need to work out how to use the Start Host Notification(23) function to enable me to use the PAUSE function. This will allow VBA to work out when RUMBA has updated from the previous call and then unlock VBA to send the next command.
Can anybody help?
Thanks,
Ollie