Hi All,
I have an ODE solver, and I'd like to be able to have the user enter the name of the function to use by name when calling the macro, so I want to use the Run(function_name,arg1,arg2,...,arg_n) function to call the function and pass arguments to it in a more flexible way.
This works fine, but it seems that the Run() function can only return a single (scalar) value. I've written the code, however, so that an arbitrary of variables can be solved for simultaneously, so function_name() returns an array. When I call function_name() using Run() such that an array is expected, Excel crashes.
The code is functional if I replace
Run(function_name,arg1,arg2())
with
function_name(arg1,arg2())
and returns correct values for all variables, but I hate that I have to rewrite the code every time I want to use a different function.
How can I get an array from Run()? Or how else can I make it so the function to be called is variable?
Thanks,
Tim
******** type="cosymantecnisbfw" cotype="cs" id="SILOBFWOBJECTID" style="width: 0px; height: 0px; display: block;">******** type="cosymantecnisbfw" cotype="cs" id="SILOBFWOBJECTID" style="width: 0px; height: 0px; display: block;"></object>
I have an ODE solver, and I'd like to be able to have the user enter the name of the function to use by name when calling the macro, so I want to use the Run(function_name,arg1,arg2,...,arg_n) function to call the function and pass arguments to it in a more flexible way.
This works fine, but it seems that the Run() function can only return a single (scalar) value. I've written the code, however, so that an arbitrary of variables can be solved for simultaneously, so function_name() returns an array. When I call function_name() using Run() such that an array is expected, Excel crashes.
The code is functional if I replace
Run(function_name,arg1,arg2())
with
function_name(arg1,arg2())
and returns correct values for all variables, but I hate that I have to rewrite the code every time I want to use a different function.
How can I get an array from Run()? Or how else can I make it so the function to be called is variable?
Thanks,
Tim
******** type="cosymantecnisbfw" cotype="cs" id="SILOBFWOBJECTID" style="width: 0px; height: 0px; display: block;">******** type="cosymantecnisbfw" cotype="cs" id="SILOBFWOBJECTID" style="width: 0px; height: 0px; display: block;"></object>
Last edited: