Is there a way to execute a literal such as,
UseValueKey = ExecuteMethod("Date()")
I want to have the variable UseValueKey return the actual date.
I am using VBA.
Any ideas?
Is there a way to execute a literal such as,
UseValueKey = ExecuteMethod("Date()")
I want to have the variable UseValueKey return the actual date.
I am using VBA.
Any ideas?
Perhaps I'm not exactly following you, but you should be able to use
Date
for example
UseValueKey = date
If, as indicated in the question comments, the function name is known and can be delivered as a method on a class, try looking at
CallByName object, routine, callType
where callType indicates whether the called routine is a property Get/Let/Set or a Method.
It feels a lot less kludgey (and somewhat better controlled) than fooling with code evaluation, where you may be leaving yourself open to, er, unexpected consequences...