jeudi 5 mai 2016

Unable to .getdisplaytext consistantly on Reflection

I need your assistance on the below. 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()

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





Aucun commentaire:

Enregistrer un commentaire