I'm having an issue with the Get property from a custom class in VBA (Excel 2010). If an index argument is not given, then my Get property should return a reference (at least that's my impression) to the Class' array. If an index is given, it should return the value in the given index in the private array.
' Custom Class Properties
Private pMtbSheets() As String
'Get and Let Methods
Public Property Get MtbSheets(Optional index As Variant) As String()
If IsMissing(index) Then
ReDim MtbSheets(1 To UBound(pMtbSheets))
MtbSheets = pMtbSheets()
Else
ReDim MtbSheets(1 To 1)
MtbSheets(1) = pMtbSheets(index) '**Compiler error occures here**
End If
End Property
Thanks for any help anyone is able to offer