B
Baz Star
I must have missed something somewhere, but having
created a colection of class objects, each of which
contains a collection of other classn objects (nested 4
deep), I need to manipulate certain levels of the
hierarchy without affecting the original structure.
However creating a new collection and copying an object
across (using ByVal and declaring a new object) looks
like a copy has been made. However, manipulating this
object results in the original object also being changed.
Since referencing is by value, and a new collection
created, I would have thought the copied class would have
been unrelated to the original, but not so it seems.
Repeating the exercise using classes in VB6 gave the same
result. Short of creating new class objects and setting
the properties one by one (which proves tedious given the
sub collections), what is the best way to achieve an
object copy between collections in vba?
Regards.
created a colection of class objects, each of which
contains a collection of other classn objects (nested 4
deep), I need to manipulate certain levels of the
hierarchy without affecting the original structure.
However creating a new collection and copying an object
across (using ByVal and declaring a new object) looks
like a copy has been made. However, manipulating this
object results in the original object also being changed.
Since referencing is by value, and a new collection
created, I would have thought the copied class would have
been unrelated to the original, but not so it seems.
Repeating the exercise using classes in VB6 gave the same
result. Short of creating new class objects and setting
the properties one by one (which proves tedious given the
sub collections), what is the best way to achieve an
object copy between collections in vba?
Regards.