Les,

Need to remove this line in the UDF example
Dim $PC

That name is being supplied as a parameter.