Reputation: 5168
I am working on little script and made wrong decision to do it in VBS.
...
result = FindAndUpdate(objDictionary, id)
...
Function FindAndUpdate(objDictionary, id)
MsgBox(objDictionary.Count)
FindAndUpdate = true
End Function
Now I am struggling with things that doesn't make any sense. I am passing Dictionary object to function. In function MsgBox(objDictionary.count) executes and I get number 15 in alert box, but immediately error gets reported on the same line Object Required: 'objDictionary'
Any help is appreciated
Upvotes: 1
Views: 3713
Reputation: 3111
You might add a check for the objDictionary and exit your function if it doesn't exist:
Function FindAndUpdate(objDictionary, id)
If Not IsObject(objDictionary) Then
FindAndUpdate = false
Exit Function
End If
MsgBox(objDictionary.Count)
FindAndUpdate = true
End Function
Upvotes: 2