Check if the Object is Empty/Null - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others) +--- Thread: Check if the Object is Empty/Null (/Thread-Check-if-the-Object-is-Empty-Null) |
Check if the Object is Empty/Null - manojith1984 - 05-19-2009 Hi Ankur , Code: Set Object = CreateObject("Excel.Application") In this code i need to check if the Object is "Null/Empty" after setting the Object to Nothing. But this code does not provide what is expected. Could you help me out in this regards. RE: Check if the Object is Empty/Null - manojith1984 - 05-20-2009 Hi, I myself found the solution. * We set an Object to Nothing i.e Set Object = Nothing * Now we need to Check if the variable 'Object' is 'Null/Empty' * Here we cannot use IsNull/IsEmpty/IsObject because all returns True even if the 'Object' is 'Null/Empty' * Hence the solution is Code: Set oNothing = Nothing Compare the two objects 'oNothing' and 'Object' using the Is condition If both the values are true the result is met. |