Random "The specified cell does not exist." error with GetCellData method (webtable) in qtp <p>I am using <code>GetCellData</code> method of <code>WebTable</code> object in qtp to fetch each cell value of a webtable which has multiple rows across multiple pages and write to datasheet. Below is the code that I am using:</p> <pre><code>For i = 2 to rowct For j = 1 to colct Datatable.Value(j+1,"sheet1") = trim(frame1.WebTable("table1" ).GetCellData(i,j)) Next Next </code></pre> <p>row and column counts are fetched before the for loops as shown below:</p> <pre><code>rowct = frame1.WebTable("table1").RowCount colct = frame1.WebTable("table1").ColumnCount(1) </code></pre> <p>But sometimes, I get the following error for some cells and I can not see any pattern so far, which makes me think this is a random issue:</p> <blockquote> <p>ERROR: The specified cell does not exist."</p> </blockquote> <p>Some more info:</p> <ol> <li><p>Usually first row has this error:</p> <blockquote> <p>Please enter a search.</p> </blockquote></li> <li><p>The error is at cell level and not at webtable / row level. Although in most of the occasions, I see when there is such error with one cell, the entire table (as I am writing to datatable) has the same error.</p></li> <li><p>When such error occurs, I have seen that number of rows fetched is greater than actual number of rows in webtable. That is, if there is one row in actual table, then my datatable has 5 rows (and so on). Again this is random.</p></li> <li><p><code>i = 2</code> in the for loop because I don't want the first row as it contains headers.</p></li> </ol> <p>Been stuck on this for a while, any help is greatly appreciated !</p>