cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Loop in VBS script recording

Former Member
0 Likes
4,626

Hi

I am new to both SCN and scripting and am in need of some guidance.

I have a SQ01/2 query, which gives the following results:

I have then recorded the following script:

This script works fine, but I need it to loop to the next selectedRow (which is the Delivery column) and then continue looping until there are no more lines.

I would really appreciate it if someone could help me.

Many Thanks

Smon

View Entire Topic
script_man
Active Contributor
0 Likes

Hi Simon,

welcome to the forum. You could try the following in the further tests.

for example:

. . .

session.findById("wnd[0]").maximize

set GRID = session.findById("wnd[0]/usr/cntlCONTAINER/shellcont/shell")
myRow = 0

if GRID.rowCount >= 1 then
  do
   GRID.selectedRows = cstr(myRow)  
   GRID.doubleClickCurrentCell

   'Here is the rest of your script after the command with ". doubleClickCurrentCell" to the end.


   myRow = myRow + 1
   if myRow >= GRID.rowCount  then exit do
   GRID.firstVisibleRow =   myRow

   GRID.selectedRows = cstr(myRow)

  loop
end if

Regards,

ScriptMan