How to get the data from the next column after user fetches data from first column?
Scenario is ==> In the same sheet I have two columns of data, from one of the subroutines I am calling the data from first column and from another subroutine I am calling the data from second column.
When I execute both the routines sequentially, TC shows an error (attached) when the driver is called in the second subroutine.
Please clarify me on this.
Set Driver = DDT.ExcelDriver("C:\Test\TestAuto.xls","TestFlow")
while Not (Driver.EOF)and Not(FoundFlag)'Start Read Excel
if(Driver.Value("A")=anyStringORParameter)then 'Read fromcolumn A2
FoundFlag=Driver.Value("B")'read from Column B2
driver.next 'Jump to next line
You get this error, because your driver has gone through all the rows in your document and reached the EOF. If you want to read values from another column, close the current driver (see the "DDT.CloseDriver" help topic) and create a new one.
Also, you can read values as maxim_gimp suggests above.