N
Neal Zimm
Hi,
I have subs and functions that take in and update public type records.
No problem when: Sub Name(InRec As uTypaA, more args.....
Is there a way to optionally write a public type ?
VBA won't allow: Sub Name(Arg1, Arg2, optional uRec As uType = ???
I guess since there's no constant value to assign to the fields.
I get the late bound error msg when I tried this:
Sub Name(prior args....., optional uRec as variant = "")
Dim uWantRec As KnownType
uRec = uWantRec
I can guess VBA must know the Type to initialize the fields. Is it the same
thing by making the public type I want one element of a ParamArray ?
It seems a waste to put the "As KnownType" in the argument list, not
optionally, and then sometimes update the fields, and sometimes not.
Is that the best there is to optionally update and output a public type
record from a sub or function ?
Thanks,
Neal
I have subs and functions that take in and update public type records.
No problem when: Sub Name(InRec As uTypaA, more args.....
Is there a way to optionally write a public type ?
VBA won't allow: Sub Name(Arg1, Arg2, optional uRec As uType = ???
I guess since there's no constant value to assign to the fields.
I get the late bound error msg when I tried this:
Sub Name(prior args....., optional uRec as variant = "")
Dim uWantRec As KnownType
uRec = uWantRec
I can guess VBA must know the Type to initialize the fields. Is it the same
thing by making the public type I want one element of a ParamArray ?
It seems a waste to put the "As KnownType" in the argument list, not
optionally, and then sometimes update the fields, and sometimes not.
Is that the best there is to optionally update and output a public type
record from a sub or function ?
Thanks,
Neal