Hi
I have now discovered what the problem was with my previous
elegant attempt.
When setting the
ProjectSuite.Variables.VariableByName(var) variable, I am assigning it to an object, therefore setting this equal to
var, as in my first attempt (
set ProjectSuite.Variables.VariableByName(var) = var) was wrong as
var was simply being interpreted as a string. My second attempt, as detailed below, works as I am now assigning
ProjectSuite.Variables.VariableByName(var) to an evaluated
var, which is, of course, an object.
Sub setPSvars(varList)
Dim var
For each var in varList
set ProjectSuite.Variables.VariableByName(var) = eval(var)
Next
End Sub
Just thought I'd post this update for anyone whose interested and hope it helps someone else in the future - I know I spend long enough trying to figure it out!!