Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
value expression RayB Excel Worksheet Functions 7 January 17th 07 09:57 PM
need help with expression Peterpunkin Excel Discussion (Misc queries) 5 May 4th 06 05:56 PM
Evaluate and execute a string Randall[_6_] Excel Programming 3 August 4th 05 05:19 PM
Giving the String expression for Numeric Values.... Arijit Chatterjee Excel Programming 2 November 19th 03 10:57 AM
Execute a command line app but i want a string returned. dei Excel Programming 0 October 23rd 03 08:18 AM


All times are GMT +1. The time now is 09:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"