Link to home
Start Free TrialLog in
Avatar of IsleOfView
IsleOfView

asked on

Executing a String from an Array

I have a series of strings in an array.  These strings are actually VB commands that I want to execute.  How can I tell VB to execute a certain index from an array?
Avatar of SPECIALIST
SPECIALIST

It depends on what you want to do.  Give a specific example of what you want to do.  


Specialist

Avatar of IsleOfView

ASKER

Well, let's go from just the simplest example.
let's say that:

Array(0) = MsgBox "Hello World!"
Array(1) = MsgBox "Hello Again!"

Whatever--I would like to have these strings act as if they were a part of the module I am working in.  They should be able to call functions from other modules as well.

TIA
Sub AMessage(Index as Integer)
    Msgbox Array(Index)
End Sub
Perhaps I'm not being clear--I don't know for sure that the array is going to contain, say, a msgbox command.  It might be something changing a property...The idea is to use the string contained in the array as a VB statement.
ASKER CERTIFIED SOLUTION
Avatar of mark2150
mark2150

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial