Does VBA have a function like JScript's EVAL()?
For the example you gave, use CallByName Function
Callbyname MyObject,Property,vbset,varvalue
Quote:
> In JScript you can use the Eval() function to concatenate strings and
> variables into statements that will execute.
> FOR EXAMPLE:
> =========================================
> Dim varProperty, varValue
> varProperty = "Year"
> varValue = 1995
> Eval("MyObject." & varProperty & " = " & varValue).
> =========================================
> The EVAL() function executes this line as if I had typed:
> MyObject.Year=1995.