Hello friends,

I tripped over the following problem:
I write a class module named SomeObject to make an object which has two public variables, a long and a string, as properties:
Code:
'the contents of the class module
Public lVar As Long
Public sVar As String
Then I have a sub which modifies a long and a string which are passed by reference
Code:
Private Sub ModifyByRef(ByRef lv As Long, ByRef sv As String)
  lv = 10
  sv = "gaga"
End Sub
Now for the problem: I declare an object of the above mentioned type, fill some values in and pass the values to the modifying routine, but no modifying takes place.
Code:
Private Sub btnTestObj_Click()
  Dim so As New SomeObject
  so.lVar = 1
  so.sVar = "abcd"
  Print so.lVar, so.sVar
  ModifyByRef so.lVar, so.sVar
  Print so.lVar, so.sVar
End Sub
There is no error. It seems to be ok to pass the objects properties, which in fact are simple public variables, byref to the modifying sub, also as long as within the sub you can verify single stepping that a modification takes place. Nevertheless, when returning, the old values persist.

Why???