Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run/Execute string expression
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"").AddField s(""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 :) :) -- Hammas ------------------------------------------------------------------------ Hammas's Profile: http://www.excelforum.com/member.php...o&userid=27642 View this thread: http://www.excelforum.com/showthread...hreadid=471651 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
value expression | Excel Worksheet Functions | |||
need help with expression | Excel Discussion (Misc queries) | |||
Evaluate and execute a string | Excel Programming | |||
Giving the String expression for Numeric Values.... | Excel Programming | |||
Execute a command line app but i want a string returned. | Excel Programming |