How to Fix “Invalid Use of Null “ Error in UFT?

This error will occur when you are trying to retrieve value from Excel sheet where it contains null value. i.e, if the Excel contains 5 rows and 5 columns among them few of the cells contains null values.

Solution:

To fix this error you have to write one precondition to the variable where you are storing the data, It means you have to assign an Empty to the variable if cell contains Null value.

For example if “Strval” is a variable where you are storing the Excel data, then you have to write the preconditions like

If  IsNull(Strval) then

                Strval= “ “

End If

As shown above you need to set empty value to the variable