I would greatly appreciate any ones help on this one.
I would like to run/execute code that is stored as a sting in excel, I think I have part of the problem solved.... I can get the following piece of code to work using a function eval (from mircosoft access 9.0 object library)
------------------------------------------------------------------------------
Sub test()
Dim codetest As String
codetest = "msgbox(""HELLO"")"
eval codetest
End Sub
------------------------------------------------------------------------------
.......but when I try and use it on an excel object like this
snippet of pivottable code then...
------------------------------------------------------------------------------
dim codetest as string
codetest = ("ActiveSheet.PivotTables(""PivotSpend"").AddFields(""Spend"")")
eval codetest
------------------------------------------------------------------------------
....I get this error
mircosoft access can't find the name activesheet you entered in the expression.
Any ideas on how I can get it to work?? Or is there another way to solve this problem...
Thanks![]()
![]()
Bookmarks