Originally posted by gwdash
1. try multiple calls to the function, one for each line

2. yes:
VB Code:
  1. TheString = "msgbox ""This is a " & MyVariable & " message"""
  2. Debug.Print FExecuteCode(TheString, False)
Thanks gwdash, but thats not quite what I meant. In your example the calling prog is converting the the variable to its contents before sending it to the API call.

suppose I wanted to execute this code

x=y+z

and I wanted to supply y and z and return the x for use by the calling prog. Also Id like the code string to have access to all prog properties (text1.text, etc) . Can this be done?

Thanks again for the information. This will help me out a lot if I can figure out how to make it work.