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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AttachMate Extra: Capture and compare information - Help me please!!!!!

Status
Not open for further replies.

DougExtra21

Programmer
Oct 26, 2017
11
BR
Hello!

I am a beginner in VBA and would like to know how to find information on the screen to take a certain action.

I can do the loop to repeat the action when a cell in Excel is filled, however I need to locate a sequence of characters on the screen and when located, I would use the "SendKeys" method to take an action inside this screen.

All code is ready, but I can not do this.

Can you help me?

Forgive me for English, I do not speak fluent English.
 
Hi,

Are you coding in Extra VB (yuk!) or are you coding in Excel VBA (hurray!!!)?

Please post the code that you are using.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Thanks for the answer

I'm using VBA, but i do not have a good logic to continue

Code:
    Dim Sessions As Object
    Dim System As Object
    Dim ExcelApp As Object
    Dim myinfo As String
    
    Set System = CreateObject("EXTRA.System")
    Set ExcelApp = CreateObject("Excel.Application")
    
    Dim Sess0 As Object
    Set Sess0 = System.ActiveSession

'If the captured information is the same as cell "B2" then

'Position cursor in front of what was found and

    Sess0.Screen.SendKeys (<left><left><left>"S"<PF2>)

'after the above command search for the word "RPER" and position cursor on the front of what was found and

    Sess0.Screen.SendKeys (<left><left>"S"<PF12>)
    Application.Wait (now + TimeValue ("00:00:01"))

    Sess0.Screen.SendKeys ("R"<tab><tab>"1234")

if at line 22, column 02 = "" then
Sess0.Screen.SendKeys ("123456789" <enter>)

else

Sess0.Screen.SendKeys (<enter>)

end if

As you can see, I only know how to send commands from the keyboard to the screen, but not to search according to the cell

Thanks for your attention,
 
Thank you for posting your code. I assume that you’re coding in Excel VBA. So your code does not need to create an Excel Application object.

So typically when you have a terminal emulator application like Attachmate Extra, that emulates a dumb terminal of some kind, you are dealing with transactions or screens. It might behave something like this, once you have logged into the mainframe system via your emulator.

1) Clear te screen and enter a transaction or screen name as a command, like:
/FOR REQORDS

The mainframe system responds by painting the screen with a the REQORDS form.

2) With the empty form on the screen, you, or your program, are ready to enter one or more search terms into formatted fields in the form.

3) Once the search term(s) are entered, then you SEND a command to the mainframs that instructs the mainframe program to do something, perhaps fill the form with data relevant to the search terms that were just SENT to the mainframe.

4) When the mainframe has completed obtaining the data and returning the data to the form, now you, or your program, must take some or all of the data and put it somewhere else, like in a spreadsheet.

I often provided a service for my users. They would provide me a list of items in a speradsheet, and a request to get certain data for each item. I knew which transaction I needed to access, so my program would loop through the list of items, fill the item on the form, SEND the appropriate command, wait for the mainframe to return the data, grab ALL the data from the form, put the data into a spreadsheet containing all the fields on the form and repeat for each item in the list.

What does your process look like?

It would help us if you would also post a copy of this screen and the list of items you are using from Excel, so that we can see the value in B2 and the corresponding value on your screen.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Hi SkipVought !!!

First thanks for your attention

I work in the financial area using banking systems and because of the rigid security I can not prove to exemplify better.

What I can try is the following:

First: the system will type the search key in cell A1 (image1)

As for the search key, I usually access it because all the names are registered in the system. Once it is accessed, it enters the screen called "Find Transaction".

Up to this point I can successfully access using the search name and access to the screen.

I got a test version of the software and I'll try to explain it this way:

I search the system the client "Douglas", according to cell A2. When I access the screen (image1) I have all these letters and numbers. On this screen, I need to search the information 123456789 and position the cursor before the first number (look that cross-line indicates where the cursor position). If on the run it does not find this information, it will look for the John client with the key that is in cell B3 and so on to where to end the list. If it finds it it will enter the letter "S" and press F2 (same as the Sendkeys command that I reported before).

On the screen he accessed, he will search for the word "Process the mail log", put the letter "V" and press F2. (image2)

When he gives this action, the system will display the message "Send with success" and will search for the client Michael and repeat the whole process.

I hope I have succeeded in showing what I really need with this example.

Sorry for not being able to leave better examples.

Thanks for your attention!!!!
 
 http://files.engineering.com/getfile.aspx?folder=ff0e14dc-6dbe-4418-856e-093ee68e472c&file=image.png
I only see one image showing two screens 1) VM/SP & 2) PROFS MAIN MENU.

Plz upload image 2.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
First: the system will type the search key in cell A1

Where does “the system” get the search key to put it into A1 on the Excel Spreadsheet?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
The worksheet is populated by a user. What this macro would do is paste the information from column A1 and press enter to access the client. Then he would look up the information in column B2 and so repeat until the columns information is finished.
 
Why A1 and B2?

Are you sure it’s not A2 and B2?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
So how is the value in A2 searched for?

What screen?

Where on that screen is the value entered?

What command is sent to the mainframe?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top