I have a function called "HasProperty" which is part of another function called "Public Function CarryOver" taken from ( few years back. This code was working for years but for some strange reason is now showing the following error in Line 6 below:
varDummy = obj.Properties(strPropName)
Public Function HasProperty(obj As Object, strPropName As String) As Boolean
'Purpose: Return true if the object has the property.
Dim varDummy As Variant
On Error Resume Next
varDummy = obj.Properties(strPropName)
HasProperty = (Err.Number = 0)
End Function
Could anyone possibly explain why this is happening with this code. Any assistance would be greatly appreciated.
varDummy = obj.Properties(strPropName)
Public Function HasProperty(obj As Object, strPropName As String) As Boolean
'Purpose: Return true if the object has the property.
Dim varDummy As Variant
On Error Resume Next
varDummy = obj.Properties(strPropName)
HasProperty = (Err.Number = 0)
End Function
Could anyone possibly explain why this is happening with this code. Any assistance would be greatly appreciated.