Returns an Error object containing information about the script error.
Returns an Error object containing information about the script error.
Visual Basic |
---|
Public Property Error As Error |
The returned Error object is used for both compilation and run-time errors.
Note: not all Error object properties are valid at all times. When a property is not appropriate for a specific error, its value will be 0 or a zero-length string ("").
Private Sub Form_Load() Dim SC As ScriptControl Dim m As Module Dim Result As Variant Set SC = New ScriptControl SC.Language = "JavaScript" SC.AllowUI = True SC.SitehWnd = Me.hWnd SC.UseSafeSubset = False SC.Timeout = 60 On Error Resume Next ' Exception Result = SC.Run("eval", "1/c") If SC.Error.Number <> 0 Then Debug.Print "Error Code:" & SC.Error.Number Debug.Print "Error Desc:" & SC.Error.Description Debug.Print "Error Text:" & SC.Error.Text Debug.Print "Error Line:" & SC.Error.Line Debug.Print "Error Col:" & SC.Error.Column End If Result = SC.Eval("1/0") 'INF End Sub