"Lance" <Lb******@yahoo.com> wrote in message
news:D6*********************@newsc.telia.net...
Hi All,
I would like to read commands from a file and execute them in VB, something
like reading str = "hello world" into VB and execute it. Any suggestions
will be appreciated.
Thanks,
Lance
Try out the often overlooked Microsoft Script Control 1.0, available in your
list of components to add to a project. With a script control called SC1 on a
form, you can do things like this:
Private Sub Command1_Click()
Dim strCode As String
strCode = "Sub HelloSub()" & vbNewLine
strCode = strCode & "strHello = ""Hello World""" & vbNewLine
strCode = strCode & "Msgbox strHello" & vbNewLine
strCode = strCode & "End Sub" & vbNewLine
Debug.Print strCode
SC1.AddCode strCode
SC1.Run "HelloSub"
End Sub