View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Can one function get another's ParamArray?

I don't quite understand your question. Your X function doesn't "have" a
ParamArray of its own, it has what is passed into it. If you call the
function X, you would need to pass the elements that will be assigned to the
ParamArray within your call to the function which would mean you *know* the
elements being passed and would not have to "ask" the X function for them.
Perhaps if you give us some detail as to what you have set up and what you
are trying to do with that setup, then maybe we can be of more help.

--
Rick (MVP - Excel)


"Jim Luedke" wrote in message
...
Either this is so simple & stupid that it's staring me in the face, or
it's a real challenge:

I have a cell function:

Function x(ParamArray Params())

with which the user can pass a lot of miscellaneous junk:

=x("abc",123,y(999),z(y(999)), ...)

At VBA runtime, from *another* internal (not worksheet) function, I
want that ParamArray--i.e. "abc", "123", "y(999)", "z(y(999))", etc.

I'll take 'em any way I can get 'em--a string or variant array'd be
fine.

Since .Formula is just a stupid string, I'm currently--<cringe--using
brute force trying to parse all the commas and parens. I'll tell ya,
it gets hairy with nesting. (And I suppose parsing multiple nesting
levels might require recursion.)

I want something like "Application.Caller.CellFunction.Params()" or
"Cell.FunctionCall.ParamArray()" or whatever.

In other words I want to "simulate" a call to x() to get its
ParamArray.

Or to use a Web analogy, I want to "pull" the ParamArray when it's not
being "pushed" to me.

Is there such an animal?

Thanks a-much.

***