在form中放入2个textbox和1个按钮,并且单击工程-〉部件,在框中加入“Microsoft Script Control”,添加完以后在工具箱找到它,放一个在form中即可使用
Private Sub Command1_Click()
On Error GoTo errhandler
ScriptControl1.Language = "vbscript"
Text2 = ScriptControl1.Eval(Text1)
Exit Sub
errhandler: MsgBox "出错了..."
End Sub