Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Handling in VBA
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00840116
Message ID:
00840122
Vues:
34
Ok, I'll be more descriptive:
Option Explicit
Sub Main()
    On Error GoTo OnError
    Call function1
    Call function2
OnError:
    Debug.Print Err.Number
    Debug.Print Err.Description
    Call ErrorHandler
End Sub

Sub function1()
    Dim aa As Integer
    aa = 2 / 0
End Sub

Sub function2()
'
End Sub

Sub ErrorHandler()
    On Error GoTo 0
    MsgBox "Halabaloo!"
End Sub
Also take a look at On Error Resume Next option and this link
http://www.keysound.com/html/error_faq.htm
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform