excel vba - Passing objects to procedures in VBA -
i working on simple tool allow me parse multiple csv files , spit them out onto fresh worksheet "merged" together. here implementation (i've simplified it) , issue:
class a
private variables types property methods accessing variables
class b
private variables types property methods accessing variables
class c
private ca classa private cb collection 'collection of classb
class d - part of problem
private cc collection 'collection of classc 'other member variables , property get/lets public sub adda(a classa) if cc.item(a.foo) nothing dim tempc classc set tempc = new classc tempc.a = end if end sub
main module - other half of problem
dim cc new classc 'initialize class c, works fine dim tempa classa set tempa = new classa 'set tempa properties cc.adda tempa 'this error
i've tried passing byval
, byref
each gives me different errors ("byref argument type mismatch", "invalid procedure or argument", , "object doesn't support property or method"
i have no idea try next, tried parenthesis "thing" supposedly forces parameter either byval or byref, can't remember, yesterday.
thanks.
this line:
tempc.a =
means "assing a
property of tempc
object value of default property of a
object."
a
object apparently doesn't have default property.
what meant probably:
set tempc.a =
but then, can't access private field a
of c
class d
class. make field public or create public seta()
method on c
class , call d
.
Comments
Post a Comment