Hey WoF
Not sure if this what you want....
I made two properties in the class :
Then, it is easier to manipulate these values from the form. In the Form, I did this :Code:Option Explicit 'the contents of the class module Private lVar As Long Private sVar As String Public Property Get L_Long() As Variant L_Long = lVar End Property Public Property Let L_Long(ByVal vNewValue As Variant) lVar = vNewValue End Property Public Property Get S_String() As Variant S_String = sVar End Property Public Property Let S_String(ByVal vNewValue As Variant) sVar = vNewValue End Property
That was the only way i get this right. I think I'm not very bright or my brain is frozen this morningCode:Option Explicit Dim so As New SomeObject Private Sub Command1_Click() 'Dim so As New SomeObject ' so.lVar = 1 ' so.sVar = "abcd" so.L_Long = 1 so.S_String = "abcd" ' Print so.lVar, so.sVar Print so.L_Long, so.S_String ModifyByRef 10, "LADY gaga is Crazy" 'so.lVar, so.sVar Print so.L_Long, so.S_String End Sub Private Sub ModifyByRef(ByRef lv As Long, ByRef sv As String) ' lv = 10 ' sv = "gaga" so.L_Long = lv so.S_String = sv End Sub. But, in any case, I hope it helps.





. But, in any case, I hope it helps.
Reply With Quote