×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• 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.

# 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

(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,
Don't let the Diatribe...
talk you to death!

Just traded in my old subtlety...
for a NUANCE!

(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.

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:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!