There is a function in application layer called evaluate.
sub foo()
dim x as double, y as double
x = 2
dim s as string
s = "sqrt(" & x & ")"
y= evaluate(s)
end sub
This sub uses the worksheet function sqrt rather than the VBA function sqr. This can be useful if you have functions defined in the xl4 interface, however it uses a context switch thus can be slow
HTH
Phineas
|