here is my sample code. i reall cant figure out how to copy a rumba string/data to excel
'CONNECT TO RUMBA
Public Declare Function WD_ConnectPS Lib "D:\\Program Files (x86)\\Micro Focus\\Rumba\\System\\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal NameSpace As String) As Integer
'SEND KEY OR TYPE IN RUMBA
Public Declare Function WD_SendKey Lib "D:\\Program Files (x86)\\Micro Focus\\Rumba\\System\\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal KeyData As String) As Integer
Public Declare Function WD_CopyStringToField Lib "D:\\Program Files (x86)\\Micro Focus\\Rumba\\System\\Ehlapi32.DLL" _
(ByVal hInstance As Integer, ByVal Position As Integer, ByVal Buffer As String) As Integer
'COPY THE STRING FROM RUMBA SCREEN
Public Declare Function WD_CopyPSToString Lib "D:\\Program Files (x86)\\Micro Focus\\Rumba\\System\\Ehlapi32.DLL" _
(ByVal hInstance As Long, ByVal Position As Integer, ByVal HoldString As String, ByVal Length As Integer) As Integer
Sub ConnectRumba()
connectr = WD_ConnectPS(1, "B")
If connectr = 0 Then
Else
Call ConnectRumba
End If
End Sub
Sub PressRumbaEnter()
RV = WD_SendKey(1, "@E")
End Sub
Sub GetDate()
Dim GetString, PutString, LB, POL As String
Dim X As Integer
Dim CCCC As String
Set Wb = ThisWorkbook.Sheets("Policy").Cells
LR = ThisWorkbook.Sheets("Policy").Range("b" & Rows.Count).End(xlUp).Row
For X = 2 To LR
LB = Wb(X, 1).Value
POL = Wb(X, 2).Value
Call ConnectRumba
If Len(POL) = 4 Then
POL = "00000" & POL
ElseIf Len(POL) = 5 Then
POL = "0000" & POL
ElseIf Len(POL) = 6 Then
POL = "000" & POL
ElseIf Len(POL) = 7 Then
POL = "00" & POL
ElseIf Len(POL) = 8 Then
POL = "0" & POL
End If
PutString = WD_CopyStringToField(1, 5, LB)
PutString = WD_CopyStringToField(1, 14, POL)
PutString = WD_CopyStringToField(1, 28, "Payment")
Call PressRumbaEnter
Variable = WD_CopyPSToString(1, RowCol(3, 30), CD, 4)
ThisWorkbook.Sheets("Policy").Cells(X, 3).Value = CD
Next X
End Sub
Function RowCol(RowIndex As Long, ColumnIndex As Long) As Long
RowCol = ((RowIndex - 1) * 80) ColumnIndex
End Function
#Rumba




