my function gets a collection and the items may be Objects or primitives how can I assign the item to a variant?
What I do now looks something like this:
Dim vItem As Variant
On Error Resume Next
vItem = oCollection.Item(sKey)
If Err.Number = 91 Then
Set vItem = oCollection.Item(sKey)
On Error GoTo 0
I think it works, but I wonder if there is a better way to do it.