I've upgraded a class from VB6 to VB.NET to be used in Excel via COM.
In VB6, I have a property defined in class MyScalars
as this:
Public Property Get Item(vntIndexKey As Variant) As MyScalar
Attribute Item.VB_UserMemId = 0
Set Item = mCol(vntIndexKey)
...
End Property
This seems to make it so that in Excel VBA, I can access this property without specifying it (so like a default property):
Dim oOut As Object
Set oOut = MyScalars(Range("E10").Value)
Is there an equivalent attribute in VB.NET that does this? I've tried the following but it gives an error in the VBA:
Default Public ReadOnly Property Item(ByVal vntIndexKey As String) As MyScalar
Get
If mCol.ContainsKey(vntIndexKey) Then
Item = mCol.Item(vntIndexKey)
End If
...
End Property