×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

HowTo, for each request I make to attachmate save more than 1 line of information?

HowTo, for each request I make to attachmate save more than 1 line of information?

HowTo, for each request I make to attachmate save more than 1 line of information?

(OP)


Hello everyone,

I'm new to tek-tips, and VBA.
I hope to contribute in the future with some useful information. At this moment I need your precious help.

So far I have been able to extract information from attachMate based on column A (Excel) and save the result to column B(row). The method I have used assumes that for each request I get 1 back. But now I face another challenge and I do not know how to make 1 request and receive 2,3,4,5,.. information lines back to column B(row). And what I find more difficult is to detect if there is more than 1 line of results and copying them to the column B(row).

CODE -->

Sub fetchNP()

Set Sys = CreateObject("EXTRA.System") ' Utilizar a sessao activa Extra X-treme
Set sess = Sys.ActiveSession
Set sess = sess.screen

Dim LastRow As Long
Dim CellData As String
Dim WS1 As Worksheet
Set WS1 = Worksheets(1)

LastRow = Range("A" & Rows.Count).End(xlUp).Row

For i = 1 To LastRow

CellData = (WS1.Cells(i, 1).Value)

sess.SendKeys "<clear>"
sess.SendKeys "XI00"
sess.SendKeys "<ENTER>"
sess.WaitHostQuiet (0)
sess.putstring "DX.55.60.05", 23, 2, 11
sess.SendKeys "<ENTER>"
sess.SendKeys "<ENTER>"
sess.WaitHostQuiet (0)
sess.putstring CellData, 4, 20, 17
sess.putstring "12.06.2019", 4, 53, 10
sess.WaitHostQuiet (0)
sess.SendKeys "<ENTER>"
sess.WaitHostQuiet (0)

If Not sess.getstring(24, 14, 11) = "Seleccionar" Then
MsgBox "number plate error " & CellData
GoTo endM
End If

WS1.Cells(i, "B").Value = sess.getstring(9, 35, 17)

'Possible information in sess.getstring(10, 35, 17)
'Possible information in sess.getstring(11, 35, 17)
'Possible information in sess.getstring(12, 35, 17)
'And so on......

next i

endM:

End Sub 

RE: HowTo, for each request I make to attachmate save more than 1 line of information?

Hi,

If it is possible that your inquiry will yield a multi-line result, then your results should reside on separate sheet/table where your column A value will be repeated for each column B result.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close