1
Private oiCustoms() As CCustomClass
Public Property Get Partners() As CCustomClass()
    Set Partners() = oiCustoms()
End Property

Public Property Set Partners(values() As CCustomClass)
    ReDim oiPartners(values.Count)
    Set oiCustoms() = values()
End Property

When I try to run I get a Compile error: Definitions of property procedures for the same property are inconsistent, or property procudure has n optional parameter, a ParamArray, or an invalid Set final parameter.

What's wrong here? I have done some looking, and it looks like I can't use an array as a property parameter. Is this correct? Any good workarounds. I will need to have this data for the object stored in an array for use elsewhere.

1 Answer 1

1

You are confusing arrays with objects.

Private oiCustoms() As CCustomClass
Public Property Get Partners() As CCustomClass()
    Partners = oiCustoms
End Property

Public Property Let Partners(values() As CCustomClass)
    ReDim oiPartners(LBound(values) To UBound(values))
    oiCustoms = values
End Property
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I had thought that an object array would need to use set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.