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 29 30 31 32 33 34 35 36 37 38 39
| Sub ProgrammePrincipale()
2 On Error GoTo Er
3 Coco
4 Lassalien
5 Constructeur
6 Exit Sub
7 Er:
8 Debug.Print Erl
9 ErrLog = "Application " & Err.Source & " ERR N° " & Err.Number & " Description " & Err.Description & " Ligne N° " & Erl & vbCrLf
10 ' Votre code pour le mail à insérer
11 ActiveWorkbook.FollowHyperlink "mailto:xyz@abc.com?cc=tuv@abc.com&subject=Rapport d'Erreurs&body=" & Replace(ErrLog, " ", "%20")
12 Err.Clear
13 Resume Next
End Sub
Sub Coco()
16 txtSub = "Sub Coco()"
17 'Bloc 1
18 txtBloc = " Bloc 1 "
19 Err.Raise 5, "Chanel.xls", "Je ne peux plus te sentir!"
End Sub
Sub Lassalien()
22 txtSub = " Sub Lassalien() "
23 'Bloc 1
24 txtBloc = " Bloc 1 "
25 Err.Raise 1664, "Léon de Brx.xls", "Erreur de choucroute!"
26 'Raitement Bloc 1....
27 'Bloc 2
28 txtBloc = " Bloc 2 "
29 End Sub
Sub Constructeur()
31 txtSub = " Sub Constructeur() "
32 'Bloc 1
33 txtBloc = " Bloc 1 "
34 Err.Raise 205, "Lion.xls", "Tu vas les rentrer vite fait tes griffes !"
35 'Raitement Bloc 1....
36 'Bloc 2
37 txtBloc = " Bloc 2 "
38
End Sub |