It works OK if you use as variant rather than as variant(), and also handles
non-range arguments.
Public Function GoodBadFunction(avVariant as Variant) as String
goodBadFunction= TypeName(avVariant)
End Function
regds
Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com
"Paul S Bryant" wrote in message
om...
I agree that the elements in the Variant() array in the GoodFunction()
are indeed of type Range. This wouldn't help me pass data to DotNet
without the PIA, but it does confirm the thing I am immediately
interested in. That is, the Excel function bar can't pass parameters
to functions requiring variant arrays unless you use the ParamArray
modifier.
"Tom Ogilvy" wrote in message
...
I believe your interpretation of GoodFunction is incorrect. If you
test
the typename of the first element of avVariant, it will be Range. No
conversion has taken place. Replace the argument with a single number,
and
as written you will get the same result.
=GoodFunction(21)
Your interpretation of BadFunction is correct in that you have a
mismatch
with argument type and the function is never entered.