Showing posts with label Script-Control. Show all posts
Showing posts with label Script-Control. Show all posts

Sunday, June 17, 2012

Cara Menggunakan Error Object Yang Ada Pada Script Control

Option Explicit

Private Sub Command1_Click()
On Error Resume Next
With ScriptControl1
.Language = "VBScript"
.AllowUI = True
.AddCode Text1.Text
.Run "Test"
End With
If Err Then
MsgBox Err & " " & Error
ListErrors ScriptControl1
End If
End Sub

Private Sub ListErrors(S As ScriptControl)
With S.Error
Debug.Print "Number:", .Number
Debug.Print "Source:", .Source
Debug.Print "Desc:", .Description
Debug.Print "Line: " & .Line, "Column: " & .Column
Debug.Print "Text:", .Text
Debug.Print "Help File:", .HelpFile
Debug.Print "Help Context:", .HelpContext
Debug.Print
End With
End Sub
READ MORE - Cara Menggunakan Error Object Yang Ada Pada Script Control