Please refer to the attached spreadsheet (it is actually an xls, but the uploader does not permit me to upload these files so I had to change the extension). This is the sheet that is equivalent to the "CreateDemo" DDT object below.
As you can see, each column does not have an equal number of entries. The Division column has 5 entries (not including the header row) while the Job Function column has 7 entries.
What the code below does is click on a link (Add Division) to reveal the textbox. Enter into the textbox and then Insert the value by clicking the Ins link.
However, when I get to the fifth and last entry of Division, this does not seem to be recognised as EOF. The EOF appears to be at the 7th entry.
I tried inserting a line that gets execution to exit the loop if the value is null but that does not seem to work. Once the loop enters the non-existent "6th" value for the Division column, the script crashes.
<font class="small">Code:</font><hr /><pre>
Do Until CreateDemo.EOF
If CreateDemo.Value(0)=null Then Exit Do
Call WKeys(Aliases.SearchSurvey.Division.TextBox,Create Demo.Value(0))
I hope it is something simple I am missing here. Thanks in advance for your help.
[ QUOTE ]
Is there an operation so that I could make it go back to the first row?
[/ QUOTE ]
The only way to do this is to create a new DDT driver which will read the same file. Before doing this, I recommend that you close the old driver by using DDT.CloseDriver as the allowed number of open connections is limited.