Forum Discussion

Azeddin_Margani's avatar
Azeddin_Margani
Contributor
11 years ago

Data-Driven loop using Excel Spreadsheet.

Hi,



Can someone, please tell me why TC doesn't pick up the second row of data from spread sheet when using Data-Driven loop. It keeps picking up the first row even when the first execution in completed. It should pickup the 2nd row and so forth..



I did try to place the cursor on the first row/line but still doesn't pick up the 2nd row.. 



Anything I should be doing...?



Regards,

Azeddin.







 
  • karkadil's avatar
    karkadil
    Valued Contributor
    Most probably you forgot using Next() at the end of the loop.



    Anyway, code example would have been helpful to find out the reason :)
  • Try this code:



    Ppath = Project.Path

    set ddtobj = DDT.ExcelDriver(Ppath & "User_Info\plan_user.xls","infotwo")

    Do While ddtobj.EOF = False

     

     

    'Actions

     

    ddtobj.Next

     

    loop

     

    Call DDT.CloseDriver(ddtobj.Name)

    set ddtobj = Nothing