05-20-2009, 10:44 AM
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
Compare the two objects 'oNothing' and 'Object' using the Is condition
If both the values are true the result is met.
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
'Set an Object i.e oNothing to Nothing
Set Object = CreateObject("Excel.Application")
Set Object = Nothing
If oNothing Is Object = True Then
Msgbox "Object is Nothing"
Else
Msgbox "Object has some values"
End If
Compare the two objects 'oNothing' and 'Object' using the Is condition
If both the values are true the result is met.