View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default Er...tell me again why I can't pass ParamArray to a Function?

I can't get that to work unless I use ByVal as in

Function Bar(Byval VParams) As String

Which is doing a copy anyway, even if its not explicit.

If I don't use ByVal I get a compile error 'Invalid use of ParamArray'

(The reason I don't want to do a copy is for performance reasons when the
parameter is a formula creating a large result set)

Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com

wrote in message
...
Aw, damn it.

My Q was prompted by several hours' worth of trouble today in trying
to remember & reconstruct the syntax I just told you works for me.

Turns out, it appears intermediate var V() is NOT necessary. This
seems to work:

Function Foo(ParamArray VParams()) As String
Foo = Bar(VParams)
End Function

Function Bar(VParams) As String

etc.

So my only Q now is why Bar's parameter can't be parallel to Foo's.

Thanks again.

***