×
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

not picking up last page

not picking up last page

not picking up last page

(OP)
i have 6 pages. each page has 6 to 23 rows
picking correctly. but last page not picking up before picking it come out from the loop.
could you help me what is wrong in the below code.
Do
         
      For i = 6 To 23
        a   = Trim(Sess.Screen.GetString(i, 11, 6))
        b   = Trim(Sess.Screen.GetString(i, 22, 10))
        c = Trim(Sess.Screen.GetString(i, 35, 20))
        d  = Trim(Sess.Screen.GetString(i, 59, 10))
            
        if Logonid <> "MVPRB" then
             j = j + 1
          
            xl_sheet_1.Cells(j, "A").Value = a
            xl_sheet_1.Cells(j, "B").Value = b
            xl_sheet_1.Cells(j, "C").Value = c
            xl_sheet_1.Cells(j, "D").Value = d
        

         Else
         End If
      
      Next

      Sess.Screen.SendKeys ("<PF8>")
      Call Wait(Sess)
   Loop Until  Ucase(Sess.Screen.GetString(24, 8, 11)) = "END OF LIST"

RE: not picking up last page

try something like this

CODE

Do
         
      For i = 6 To 23
        a   = Trim(Sess.Screen.GetString(i, 11, 6))
        b   = Trim(Sess.Screen.GetString(i, 22, 10))
        c = Trim(Sess.Screen.GetString(i, 35, 20))
        d  = Trim(Sess.Screen.GetString(i, 59, 10))
            
        if Logonid <> "MVPRB" then
             j = j + 1
          
            xl_sheet_1.Cells(j, "A").Value = a
            xl_sheet_1.Cells(j, "B").Value = b
            xl_sheet_1.Cells(j, "C").Value = c
            xl_sheet_1.Cells(j, "D").Value = d
        

         Else
         End If
      
      Next
if Ucase(Sess.Screen.GetString(24, 8, 11)) = "END OF LIST" then
exit sub
else
      Sess.Screen.SendKeys ("<PF8>")
end if
       Call Wait(Sess)
   Loop

RE: not picking up last page

(OP)
it works great. thanks  

RE: not picking up last page

(OP)
thansk vzachin

RE: not picking up last page

(OP)
after End of List i need to go to next screen and do something
how do i do that?
in if statment instead of exit sub how do i insert call funciton here


if Ucase(Sess.Screen.GetString(24, 8, 11)) = "END OF LIST" then
exit sub
else
      Sess.Screen.SendKeys ("<PF8>")
end if
       Call Wait(Sess)
   Loop
 

RE: not picking up last page




Just create another procedure and call it BEFORE the Exit Sub

Skip,
glassesDon't let the Diatribe...
talk you to death!tongue

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: not picking up last page

how about instead of EXIT SUB, use EXIT DO

RE: not picking up last page

(OP)
thanks skip

RE: not picking up last page

(OP)
vzchin
exit do will do the same page repeat. it wont end  

RE: not picking up last page

indswamy ,

exit do should exit the Do/Loop ; then you would add additional coding after the Loop

Skip's coding will work as well

glad you can work it out

zach

RE: not picking up last page

(OP)
i did call procedure. it wokrs great. thank Skip
 

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