返回列表 发帖

[电脑相关] 运行文本里的函数,字符型号做运行

Function JS(ByVal Expressions As String) As String
   Dim Mssc As Object
   Set Mssc = CreateObject("MSScriptControl.ScriptControl")
   Mssc.Language = "vbscript"
   On Error GoTo EvalErr
   JS = Mssc.Eval(Expressions)

   Exit Function
EvalErr:
   Exit Function
End Function
宁做真小人,不做伪君子

Dim run As Object
'把文本内容转为命令执行
Private Declare Function EbExecuteLine Lib "vba6.dll" (ByVal pStringToExec As Long, ByVal Unknownn1 As Long, ByVal Unknownn2 As Long, ByVal fCheckOnly As Long) As Long

Function StepLine(ByVal cmd As String) As Long
    StepLine = EbExecuteLine(StrPtr(ByVal cmd), 0, 0, 0)
End Function


Private Sub Command5_Click()
Dim tempout

StepLine ("form1.list7.SetFocus")

End Sub
宁做真小人,不做伪君子

TOP

StepLine ("form1.list7.SetFocus")
宁做真小人,不做伪君子

TOP

返回列表