Reflection 5250 question - Unable to .getdisplaytext consistantly

DSB0099

New Member
Joined
Feb 20, 2014
Messages
7
Hi Team,
I need your quick assistance on the below. I am sure it will be an easy one for you guys.
I am initiating a macro from excel which connects to reflection 5250 performing the task and retrieves certain information displayed on the screen back to excel. However one of the codes which I use to get the display is not consistently working. Sometimes it gets the messages sometimes not. I am not sure if it is due to time lag required for the function to work as even though I ask it to wait, it still does not work every time. Kindly can you assist? The problem code is ‘displayText = .GetDisplayText(23, 2, 70)’.
I have attached the code used for reflection

Sub BDLiftBLKChg() 'Code to lift BD
Set ribmapp = GetObject("RIBM")
With ribmapp
Dim displayText As String
.SetClipboardText Clear
.TransmitTerminalKey rcIBMF3Key
.WaitForEvent rcEnterPos, "30", "0", 4, 41
.TransmitANSI "MBIM"
.MoveCursor 13, 34
.TransmitANSI " "
.MoveCursor 13, 34
.TransmitANSI BDate
.TransmitTerminalKey rcIBMEnterKey

'XXXX below is the problem XXXX'
displayText = .GetDisplayText(23, 2, 70)
.Wait 1
.SetClipboardText (displayText)
.TransmitTerminalKey rcIBMF3Key
End With

End Sub

Many thanks in advance
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Watch MrExcel Video

Forum statistics

Threads
1,095,348
Messages
5,443,940
Members
405,256
Latest member
ukboyme

This Week's Hot Topics

Top