Hi,
I want to set the Let and Get property for an array variable. When i am trying to set the value for it, it gives me the error "Can't Assign to Array".. Please help me out to solve this problem. I need to do this using Properties.
Please find the code which i haev written attached with the message
Module function which calls the property
The Class Module containing the Property Functions
Please tell me what is the mistake which i am doing which is not letting me use the property functions in case of arrays.. This is working perfectly fine in case of individual variables.
Thanks & Regards,
Kapil
I want to set the Let and Get property for an array variable. When i am trying to set the value for it, it gives me the error "Can't Assign to Array".. Please help me out to solve this problem. I need to do this using Properties.
Please find the code which i haev written attached with the message
Module function which calls the property
Code:
Public Sub populateScenarioDetails()
Dim objScnroDetails As classScenarioDetails
Set objScnroDetails = New classScenarioDetails
Dim scnroFocus(20) As String
Dim scnroFocusSel(200) As String
For index = 0 To Form_TSD_Input_Form.list_FocusRight.itemsSelected.Count - 1
scnroFocus(index) = Form_TSD_Input_Form.list_FocusRight.itemsSelected.item(index)
Next index
objScnroDetails.setSelectedFocus = scnroFocus 'sets the Property with the array
scnroFocusSel = objScnroDetails.getSelectedFocus 'retrieves back the array from the property
End Sub
The Class Module containing the Property Functions
Code:
Private arrSelectedFocus(20) As String
Public Property Let setSelectedFocus(selectedFocus() As String)
arrSelectedFocus = selectedFocus
End Property
Property Get getSelectedFocus() As String()
getSelectedFocus = arrSelectedFocus
End Property
Please tell me what is the mistake which i am doing which is not letting me use the property functions in case of arrays.. This is working perfectly fine in case of individual variables.
Thanks & Regards,
Kapil