×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

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!

*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

Scrape data from top of page

Scrape data from top of page

Scrape data from top of page

(OP)
Hello everyone, im having an issue with auto scroll up to extract date from Attachmate. So basically, when im on a payment screen, it shows the bottom of the page first and then extracts only that screen. I would like it to scrape date start from top of page and works its way down to bottom. THis is the code i have so far. Thanks in advance.

CODE -->

Get the necessary Session Object
	Dim Sess0 As Object
	Set Sess0 = System.ActiveSession
	If (Sess0 is Nothing) Then
		Msgbox "Could not create the Session object.  Stopping macro playback."
		STOP
	End If
	If Not Sess0.Visible Then Sess0.Visible = TRUE
	Sess0.Screen.WaitHostQuiet(0)
	
    Dim fso as Object
    Dim ts as Object
    Dim i
    Dim strCBName
    Dim blnHasMoreLines
 
    'create the file system object
    Set fso = CreateObject("Scripting.FileSystemObject")
 
    'get the copybook name
    strCBName = "T328"
 
    'create the copybook file
    Set ts = fso.CreateTextFile("C:\temp\" & strCBName & ".txt", true)
    
    blnHasMoreLines = True
    
    ' record the loan information & column headers once
    ts.WriteLine Sess0.Screen.GetString(4, 2, 79)
    ts.WriteLine Sess0.Screen.GetString(5, 2, 79)
    ts.WriteLine ""
    ts.WriteLine Sess0.Screen.GetString(7, 2, 79)
    ts.WriteLine Sess0.Screen.GetString(8, 2, 79)
    ts.WriteLine ""
 
    'copy all lines on the screen except the header until there are no more lines
    While blnHasMoreLines
        'determine if there are more lines after the current screen

        blnHasMoreLines = (Sess0.Screen.Search("PAYMENT DATE").Value = "")

      
        
        For i = 10 to 21
            ts.WriteLine Sess0.Screen.GetString(i, 2, 79)
        Next i
        
        'send the next page command
	Sess0.Screen.Sendkeys("<Pf8>")	
	Sess0.Screen.WaitHostQuiet(0)
    Wend


    'close and destroy objects
    ts.Close
    Set ts = Nothing
    Set fso = Nothing

    MsgBox "Done recording " & strCBName 
    
    Sess0.Screen.WaitHostQuiet(0)

    System.TimeoutValue = OldSystemTimeout
End Sub 

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