Thread: Error in QTP
View Single Post

  #1 (permalink)  
Old 01-02-2008, 06:41 PM
abuzzi abuzzi is offline
Junior Member
 
Join Date: Dec 2007
Posts: 2
abuzzi is on a distinguished road
Talking Error in QTP

Hi.

I am having some problems with the following code.
_________________________________________________
Dim Count
Dim BankCount

BankCount = Int (DataTable.Value("A", dtGlobalSheet))

Count = 0

Do until Count = BankCount

Count = Count +1
msgbox Count
msgbox BankCount

wait 1

Loop
_________________________________________________

The script runs successfully, however when the scripts Count = Bankcount, the execution cycle is looping back to the beginning of the script, and produces the following error.

Error:
Type mismatch: '[string: ""]'

Details:
Line (4): "BankCount = Int (DataTable.Value("A", dtGlobalSheet))".


Could someone please tell me:

1 - Why the script loops back to the beginning once Count = BankCount
2 - Why an error is being returned on the above line of code only on the second pass / why no error is returned on the above line of code on the first pass .. ??

Looking forward to seeing your thoughts / suggestions / script alteration recommendations ...
thanks - and happy new year
Reply With Quote