View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Luedke Jim Luedke is offline
external usenet poster
 
Posts: 43
Default Can one function get another's ParamArray?

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.

***