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
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top