M
Magius96
In short, what I need is a way to execute a string as VBA code that will
allow the code in the string to modify variables within the program. I have
added the Microsoft Scrip Control 1.0 into the references, and have tried the
following code with no luck:
Function test()
Dim CodeString As String
Dim SCtrl As New ScriptControl
SCtrl.Language = "VBScript"
TestVar = 1
SCtrl.ExecuteStatement ("TestVar = TestVar + 9")
MsgBox TestVar, vbOKOnly
End Function
I need to find a way to do this, without actually knowing what variables are
going to be modified in advance. A program that I'm working on will have
different code for every entry in a table, and I want to be able to store the
code itself in the table and execute it when necessary.
allow the code in the string to modify variables within the program. I have
added the Microsoft Scrip Control 1.0 into the references, and have tried the
following code with no luck:
Function test()
Dim CodeString As String
Dim SCtrl As New ScriptControl
SCtrl.Language = "VBScript"
TestVar = 1
SCtrl.ExecuteStatement ("TestVar = TestVar + 9")
MsgBox TestVar, vbOKOnly
End Function
I need to find a way to do this, without actually knowing what variables are
going to be modified in advance. A program that I'm working on will have
different code for every entry in a table, and I want to be able to store the
code itself in the table and execute it when necessary.