|Subject:||VBA: ByRef not returning changes to passed arguments|
|Posted by:||Clif McIrvin (email@example.com)|
|Date:||Mon, 16 Mar 2009|
public myfunction(byref data as variant) as boolean
do some stuff that modifies data
dim xx as variant, x as variant
xx = some value
05 myfunction (xx)
15 x = myfunction(xx)
In the locals window at line 10, xx still contains some value but at
line 20 xx has been changed.
I've done some digging through the installed documentation (Office 2003)
and see nothing that explains why. Can someone point me towards
It seems that I first tried
05 myfunction xx
but the compiler didn't like that - it returned "argument not optional."
After changing to the line 15 syntax my macro is doing what I want, and
I'm a happy camper; just curious.