Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Object required error
#1
Solved: 11 Years, 4 Months ago
Hi guys,

Im trying to use the inStr function to check a variable (vClose) that has been read into my script from an external excel sheet.

The following piece of code -
Code:
searchString = "/"
Dim tmpVar

If (tmpVar = inStr (1,vClose, searchString, CompareMethod.Text) = 1) then
......
else
....
End If

Im getting an "Object required" error message. anyone know why this is occurring?

Thanks,
Brian
Reply
#2
Solved: 11 Years, 4 Months ago
where did u get this CompareMethod.Text from?

Also, i don't understand the way you have put (=) comparison operator

Correct syntax would be:

Code:
vclose = "22/32/45" //As an ex

searchString = "/"

Dim tmpVar

tmpVar =  inStr (1,vClose, searchString, 1) //1 for text comparison

If (tmpVar  = 3) then

msgbox tmpVar

else
...
End If
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Intermitent "Object not visible" error erodpr 5 3,525 01-14-2016, 10:55 AM
Last Post: vinod123
  Unable to identify "Authentication Required" Dialog shaunysj 2 3,212 08-04-2015, 12:55 PM
Last Post: venkatesh9032
  ERROR : Object reference not set to an instance of an object. Suyashxp 2 7,248 12-30-2014, 11:32 AM
Last Post: ursprasadp
  code required for the following scenarios krithikaachari 0 2,232 09-27-2014, 01:00 AM
Last Post: krithikaachari
  object required shipu 1 3,974 01-16-2014, 08:11 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)