I am trying to write a simple ODE solver in VBA with a user-specified

function to determine the derivatives, and I can't seem to pass arrays

back and forth between the derivative function and the ODE routine. I

have tried

holding = Evaluate(deriv & "(x,y_0)")

where

holding - a Variant to take the returned array

x - the independent variable in the ODE routine

y_0 - the array of dependent variables in the ODE routine, a

Variant

deriv - the name of the user-specified function, a String

Unfortunately, this doesn't seem to work. Is it looking for y_0

on the worksheet where the ODE routine is called? I also tried

holding = Evaluate(deriv & "(" & x & "," & y_0 & ")")

but it didn't work either. I'm a bit hazy on how VBA handles the

translation of the text string given to Evaluate, but I think the

first way doesn't work because Excel is looking for y_0 on the

worksheet where the ODE solver was called, and the second way doesn't

work because the contents of y_0 are being placed in the string

before the string is evaluated.

Is there some way I can have the user specify a function which

will accept and return arrays defined in the ODE routine? Is this

method of calling a user-provided function the closest thing to

function pointers in C? The lab is still waiting for the manuals,

but I've tried looking in Excel 5 books at the bookstores, as well

as the on-line help, without success.

Thanks,

David Garza