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?
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
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
Msgbox Array(Index)
End Sub
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Specialist