1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Dim objVbsc As New MSScriptControl.ScriptControl
Dim objProc As Procedure
Dim blnResult As Boolean
Dim blnFound As Boolean
If Not objVbsc Is Nothing Then
With objVbsc
.Language = "VBScript"
.Reset
.Timeout = -1
.AllowUI = True
.AddCode I_strVBScriptCode
'Rechercher la procédure
blnFound = False
For Each objProc In .Procedures
If StrComp(objProc.Name, I_strProcedureName, vbTextCompare) = 0 Then
blnFound = True
Exit For
End If
Next objProc
If blnFound Then
blnResult = CBool(.Run(I_strProcedureName))
Else
'Pas de procédure trouvée
End If
End With
End If |
Partager