I am trying to screen scrape the text from the mainframe to excel using excel VBA. The code gets the data but when i insert in cells, the data is corrupted because the screen text language is Arabic.
I tried to copy the screen of the main frame manually using Edit -> select All then Edit -> copy and paste in excel and it worked correctly. I need to send the (select all) and (copy) commands from excel VBA.
My Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim autECLPSObj As Object
Set autECLPSObj = CreateObject("PCOMM.autECLPS")
autECLPSObj.SetConnectionByName ("A")
Dim feedback As String
feedback = ""
feedback = RTrim(autECLPSObj.GetText(1, 1, 220))
MsgBox feedback
End Sub
Dim autECLPSObj As Object
Set autECLPSObj = CreateObject("PCOMM.autECLPS")
autECLPSObj.SetConnectionByName ("A")
Dim feedback As String
feedback = ""
feedback = RTrim(autECLPSObj.GetText(1, 1, 220))
MsgBox feedback
End Sub