New
#1
Setting default property of custom collection class
In VBA, I am trying to set the Item property of a custom collection class, clsStudents, to be the default property. The recommended way of doing this seems to be as follows:
1. Remove and export the class module
2. Change it to a txt file.
3. Add the following line to the Item property using Notepad:
'Attribute Item.VB_UserMemId = 0' giving:
Public Property Get Item(strKey As String) As clsStudent
Attribute Item,VB_UserMemId = 0
Set Item = mcol(strKey)
End Property
4. Import the txt file back into the project.
The trouble is the addition is highlighted as a syntax error!
Ken