Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Incorrect Number of Rows returned from Local Datatable
#1
Solved: 10 Years, 9 Months ago
I am trying to loop just through the rows that have data in the local data table but the test keeps trying to run through all 65535 rows in the table.

The code to grab the number:
Code:
Dim i, numRows, dtDepL, dtDepG
Set oLocalDT = DataTable.LocalSheet
numRows = oLocalDT.GetRowCount

which sets the numRows variable to the 65535 instead of the three that should be set since the data table looks like:
[Image: QTProImage.jpg]

Any Ideas? Is this a bug in the system?

(By the way, when I set the action run properties to run all rows it does the same thing. Tries to run through all 64k rows.)

Thanks,

Don
Reply
#2
Solved: 10 Years, 9 Months ago
To add to this, I DID import the local data sheet after modifying it in excel. Maybe this flags QTPro to think that the sheet is filled with data instead of actually checking for data in the cells.

Don
Reply
#3
Solved: 10 Years, 9 Months ago
Is your local Datasheet a import of any excel sheet ?? if that is the case then the rows in the excel maybe sometimes interpreted as rows with data if you had created the excel using a save as option.

If the entries are directly on the Datatable sheet then you may need to delete the test and open a new test and try again.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#4
Solved: 10 Years, 9 Months ago
Hi ,

try with the below :

Code:
Numrows=Datatable.getsheet("LocalSheetname").Getrowcount
for i=1 to Numrows
       Datatable.getsheet("LocalSheetname").SetCurrentRow(i)

    ----
    ----
Next

Note: Make sure that the following is done
File-->settings-->Run Tab , choose "Run only One iteration"
Reply
#5
Solved: 10 Years, 9 Months ago
Select all the rows from the row below where your data begins, right click and click on delete.

Save the excel and import it back and lets see what happens.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple rows of test data Bhuvana 0 1,138 01-03-2020, 09:30 PM
Last Post: Bhuvana
  Local System Monitor kbhargava505 0 2,419 10-16-2015, 12:52 PM
Last Post: kbhargava505
  Adding data into rows that add dynamically with setcelldata azar81 4 5,640 04-13-2015, 05:24 PM
Last Post: vidya2k2
  Excel operation - to find usedrange of rows & col pooja 1 9,369 02-19-2015, 04:06 AM
Last Post: supputuri
  Retrieve row number based on value in DataTable marfa 6 29,955 07-31-2014, 08:36 PM
Last Post: dharshinishankari@gmail.com

Forum Jump:


Users browsing this thread: 1 Guest(s)