I have the following variables in my VBA logic sFunctionName, sParam1, sParam2, sParam3 all string variables populated from a table. I would like to use those variables to call a function. I have tried using Application.Run(sFunctionName, sParam1) and the statement fails, However when i use Application.Run(sFunctionName) it works just fine. I have also tried Eval on someones suggestion with no luck. Can someone let me know what I am missing, or if i can even do what I am attempting to do? I appreciate any and all help.
Thanks, J
Application.Run(Arg1, Arg2....)is a function and returns a value.Application.Run Arg1, Arg2...is a subroutine call that doesn't return a value. So, if you useCall Application.Runleave out the parens. If you useMyVariable = Application.Runthen you need to use the parens. This 100% consistent behavior across VBA and always has been.callkeyword, in which case you must use the parens. I'm sure you know this already when you're not dashing off a comment, but others reading the comments may not. I'll try to find the really good article on parens in VB(A) that I read recently & thought I'd bookmarked....