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

not picking up last page

Status
Not open for further replies.

indswamy

Programmer
Jan 7, 2009
16
US
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
 
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
 
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
 



Just create another procedure and call it BEFORE the Exit Sub

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
vzchin
exit do will do the same page repeat. it wont end
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top