Results 1 to 3 of 3

Thread: Execute a string

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2009
    Posts
    2

    Execute a string

    In VBS you can execute a string to run as code.
    Here is an example:
    Code:
    strTest = "msgbox " & chr(34) & "Test." & chr(34)
    execute strTest
    I am trying to make a AD interface in excel 2007(per a user request).
    I would like to make it dynamic in that users can select what attributes they want to see.

    So, for example they can enter in cn (which returns the user's name) as one of the attributes they want. A simplified example of what I would like to do is:

    Code:
    strAttribute = Sheets("Control").Range("a1")
    execute "strUserAttribute = objUser." & strAttribute
    msgbox strUserAttribute
    Since execute isn't part of VBA, how do I do this please?
    Thanks,
    -Jeremy
    Last edited by jelliott; Apr 15th, 2009 at 01:58 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width