Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen scrape in VBA, Rumba session

Status
Not open for further replies.

Gandalph067

Programmer
Nov 28, 2012
9
US
I have been trying to create a function that would call a rumba/attachmate session already open in the background, and copy (screen scrape) the screen, returning it as a string into MS Access 2007 Variable. So far I have seen snipets and it has been sometime since I have worked to this level in MS Access. I would appreciate any thoughts.
 
Forum705

So what code do you have so far and where are you stuck?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I have been trying to setup a mainframe as an object and send it a string. I have just started with this after being away from coding for 5 years. I have been deployed oversees. I guess I have started with attempting to declare a mainframe then send keys command. It is just been so long I am having a time starting and at least getting on the right path to work it.

Dim Mainframe As Object
Set Mainframe = CreateObject("C:\user\host\rumba.w2m").CurrentHost
Mainframe.Activate
Mainframe.Maximize

Dim strCustomerNumber as String
Dim strCustomerName as String
Mainframe.ScriptExec(strCustomerNumber)
Mainframe.Keys("{Enter}")
strCustomerName = Mid(Mainframe.text, 15, 10)
 
hi,

You need something like this to create the SYSTEM or APPLICATION object.
Code:
dim oSys as object, oSess
set oSys = CreateObject("rumba.system")
or maybe its "rumba.application"
Then the emulator session
Code:
set oSess = oSys.Sessions.Open(YourPath)
or something like that. I know Attachmate Extra, but not Rumba.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
thread707-1657687 provides some further links that may be useful
 
I do stand corrected for the type of session i am working in. it is "Reflection for UNIX and OpenVMS Dialog Box, ©1994-2006 Attachmate Corporation." I was so used to the people here calling it Rumba. Gusess this is what I get from not doing my homework. I did see the piece of code you had included and thank you. But also there was a piece that had take from excel paste to Attachmate, wait, then scrape a line from the screen.

This is in essence what I am trying to do, except use access. I want to have my table, a list of names I scroll through, pick one, which brings up the detail record. One the detail record form I want to send the field to Attachmate, and wait for the session to display the record on the screen, then read from the screen, scrape with a gettxt, back to a variable in MS Access.

I do apologize for my ignorance and appreciate helping me get in the right direction
 
Since your emulator functions asynchronously with your code, you must wait for an appropriate response from the emulator, before proceeding. I'd suggest an approch like:
[tt]
1. Send the command to the emulator
2. Move the cursor away from the Screen Rest Coordinates
3. In a loop, Wait for the cursor to return to the Screen Rest Coordinates while allowing the system to DoEvents
[/tt]


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I was able to get it to send commands and scrape the data from the screen. I put in all the command functions from attachmate and they helped, my biggest issue is the time that the system takes to respond to the commands I send. I have a pause I wrote into it and it waits a second then continues, but sometimes the network is slower and they causes it to comeback with answers on the wrong screen. I did note we wanted to send away from the wait coordinates, but the sytem widow scrolls back and forth and it difficult to see if it is finished.( the response could leave you at the top or middle).

Declare Function WD_ConnectPS Lib "C:\Program Files\Attachmate\Reflection\Eehllapi.dll

Public Function GetVTUser(ByVal TempsUser As Variant)
Dim Reflection As Object
Dim tempDat As Variant

'get exisiting ssession for Vista
Set Reflection = GetObject(, "Reflection2.Session")
GetVTUser = Reflection.gettext(1, 9, 1, 45) '(A,B,C,D)
'A - start row 'B - start Column 'C - End row 'D - End Column
Pause
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top