Bonjour

J'ai une erreur de type 13 avec le code suivant..
Parfois, ce que je ne comprends pas, cela fonctionne...

Merci pour votre aide...
J'ai essayé différent types genre format de cellules ou autre mais cela ne change rien...

Merci a toutes et tous...

Code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Option Explicit
Private Sub CommandButton1_Click()
 
End Sub
 
Private Sub CommandButtonAddSeance_Click()
Dim sea As New Seance
Dim prof As New Professeur
Dim cla As New Classe
Dim room As New Salle
Dim mat As New Matiere
    If Not Start.etab.verifMat(Me.TextBox1.Value) Is Nothing Then
        Set mat = Start.etab.verifMat(Me.TextBox1.Value)
        If Start.etab.checkHour(mat) Then
            If Not Start.etab.verifClasse(Me.TextBox6.Value) Is Nothing Then
                Set cla = Start.etab.verifClasse(Me.TextBox6.Value)
                If Start.etab.checkEdT(cla, CDate(Me.TextBox3.Value), CInt(Me.TextBox4.Value)) Then
' If Start.etab.checkEdT(cla, CDate(Me.TextBox3.Value), CInt(Me.TextBox4.Value)) Then
                    If Not Start.etab.verifProf(Me.TextBox5.Value) Is Nothing Then
                        Set prof = Start.etab.verifProf(Me.TextBox5.Value)
                        If Start.etab.checkEdT(prof, CDate(Me.TextBox3.Value), CInt(Me.TextBox4.Value)) Then
                            If Not Start.etab.verifSalle(Me.TextBox2.Value) Is Nothing Then
                                Set room = Start.etab.verifSalle(Me.TextBox2.Value)
                                If Start.etab.checkEdT(room, CDate(Me.TextBox3.Value), CInt(Me.TextBox4.Value)) Then
                                    sea.init CDate(Me.TextBox3), CInt(Me.TextBox4), mat, room, cla, prof
                                    Call etab.addseance(prof, cla, sea, room, mat)
                                    MsgBox "Nouvelle séance créée !", vbExclamation
                                    'MsgBox "sea : jour " & sea.getJour & " creneau : " & sea.getCreneau & " mat : " & sea.getDiscipline.getIntitule & " endroit : " & sea.getNomEndroit & " classe : " & sea.getNomClasse & " prof : " & sea.getNomProf
 
                                    etab.stockAll
                                    Me.TextBox1.Value = ""
                                    Me.TextBox2.Value = ""
                                    Me.TextBox3.Value = ""
                                    Me.TextBox4.Value = ""
                                    Me.TextBox5.Value = ""
                                    Me.TextBox6.Value = ""
                                    'UserFormAddSeance.Hide
                                    Unload Me
                                    UserFormAccueilAdmin.Show
 
                                Else
                                    MsgBox "Erreur salle indisponible ! Veuillez réessayer.", vbExclamation
                                    Me.TextBox3.Value = ""
                                    Me.TextBox4.Value = ""
                                    Me.TextBox3.SetFocus
                                End If
                            Else
                                MsgBox "Erreur salle inexistante ! Veuillez réessayer.", vbExclamation
                                Me.TextBox2.Value = ""
                                Me.TextBox2.SetFocus
                            End If
                        Else
                            MsgBox "Erreur professeur indisponible ! Veuillez réessayer.", vbExclamation
                            Me.TextBox3.Value = ""
                            Me.TextBox4.Value = ""
                            Me.TextBox3.SetFocus
                        End If
                    Else
                        MsgBox "Erreur professeur inexistant ! Veuillez réessayer.", vbExclamation
                        Me.TextBox5.Value = ""
                        Me.TextBox5.SetFocus
                    End If
                Else
                    MsgBox "Erreur classe indisponible ! Veuillez réessayer.", vbExclamation
                    Me.TextBox3.Value = ""
                    Me.TextBox4.Value = ""
                    Me.TextBox3.SetFocus
                End If
            Else
                MsgBox "Erreur classe inexistante ! Veuillez réessayer.", vbExclamation
                Me.TextBox6.Value = ""
                Me.TextBox6.SetFocus
            End If
        Else
            MsgBox "Erreur aucune heure disponible ! Veuillez réessayer.", vbExclamation
            Me.TextBox1.Value = ""
            Me.TextBox1.SetFocus
        End If
    Else
        MsgBox "Erreur matière inexistante ! Veuillez réessayer.", vbExclamation
        Me.TextBox1.Value = ""
        Me.TextBox1.SetFocus
    End If
    etab.stockAll
End Sub
 
Private Sub CommandButtonAnnuler_Click()
    Me.TextBox1.Value = ""
    Me.TextBox2.Value = ""
    Me.TextBox3.Value = ""
    Me.TextBox4.Value = ""
    Me.TextBox5.Value = ""
    Me.TextBox6.Value = ""
    UserFormAddSeance.Hide
    UserFormAccueilAdmin.Show
End Sub
 
 
 
Private Sub Label4_Click()
 
End Sub
 
Private Sub UserForm_Initialize()
    Dim room As New Salle
    Dim prof As New Professeur
    Dim mat As New Matiere
    Dim cla As New Classe
    Dim i As Integer
    i = 1
    TextBox1.Clear
    TextBox2.Clear
    TextBox6.Clear
    TextBox4.Clear
    TextBox5.Clear
    For Each room In Start.etab.getSalles
        TextBox2.AddItem room.getNom
        Set room = New Salle
    Next room
    For Each prof In Start.etab.getProfs
        TextBox5.AddItem prof.getNom
        Set prof = New Professeur
    Next prof
 
    For Each mat In Start.etab.getMatieres
        TextBox1.AddItem mat.getIntitule
        Set mat = New Matiere
    Next mat
    For Each cla In Start.etab.getClasses
        TextBox6.AddItem cla.getNom
        Set cla = New Classe
    Next cla
    Do Until i = 11
        TextBox4.AddItem i
        i = i + 1
    Loop
 
End Sub