ByRef not working in VBA with value type from a class
Under the hood aClassInstance.publicVariable
is encapsulated as a hidden property get/let pair, so passing ByRef
is passing the address of the hidden get
properties return value, not the underlying variable declared in the class.
You can test this by examining the addresses of the 2 forms of d
within the class; they will be different
(class_init)
debug.? " d address=" & VarPtr(d)
debug.? ".d address=" & VarPtr(me.d)