Bonjour,
VBA - Excel 2010
Depuis le 7 mars 2004 cette macro VBA fonctionnait sans problème:
"Sub Lecture_Ecriture_Affinités_EuroMillions()
'
' Lecture_Ecriture_Fichier_EuroMillions Macro
' Macro enregistrée le 07/03/2004 par .............
'
Const A = 10000
Dim B(1 To A, 1 To 7) As Integer
Dim C As Integer, C1 As Integer, D As Integer, E As Variant, F As Integer
Dim Compteur(1 To 50, 1 To 50) As Integer
Dim intN1 As Integer, intN2 As Integer
Open "EUROMILLIONS\Euro_Millions/A_Partir_Résultats/Affinités_EuroMillions.xls" For Input As #1
For intN1 = 1 To 50
For intN2 = 1 To 50
Input #1, intN1, intN2, Compteur(intN1, intN2)
If intN2 = 50 Then GoTo suite1
Next intN2
suite1:
If intN1 = 50 Then GoTo suite2
Next intN1
suite2:
Input #1, C
Close #1
'C = C + 1
For C1 = C To A
For D = 1 To 7
Boucle_1:
E = InputBox("Saisir Nombre" & " " & D, "Tirage N°" & " " & C1 & " " & "(Pour FIN taper 0)"): F = E
If ((E > 50) Or (E < 0) Or (E = "")) Then MsgBox "Erreur de Saisie": GoTo Boucle_1
If ((E = 0) And (D = 1)) Then GoTo Fin_Saisie
B(C1, D) = F
Next D
Next C1
Fin_Saisie:
C1 = C1 - 1
For X = (C + 1) To C1
For intN1 = 1 To 50
For intN2 = 1 To 50
If B(X, 1) = intN1 And ((B(X, 1) = intN2) Or (B(X, 2) = intN2) Or (B(X, 3) = intN2) Or (B(X, 4) = intN2) Or (B(X, 5) _
= intN2)) Then Compteur(intN1, intN2) = (Compteur(intN1, intN2) + 1)
If B(X, 2) = intN1 And ((B(X, 1) = intN2) Or (B(X, 2) = intN2) Or (B(X, 3) = intN2) Or (B(X, 4) = intN2) Or (B(X, 5) _
= intN2)) Then Compteur(intN1, intN2) = (Compteur(intN1, intN2) + 1)
If B(X, 3) = intN1 And ((B(X, 1) = intN2) Or (B(X, 2) = intN2) Or (B(X, 3) = intN2) Or (B(X, 4) = intN2) Or (B(X, 5) _
= intN2)) Then Compteur(intN1, intN2) = (Compteur(intN1, intN2) + 1)
If B(X, 4) = intN1 And ((B(X, 1) = intN2) Or (B(X, 2) = intN2) Or (B(X, 3) = intN2) Or (B(X, 4) = intN2) Or (B(X, 5) _
= intN2)) Then Compteur(intN1, intN2) = (Compteur(intN1, intN2) + 1)
If B(X, 5) = intN1 And ((B(X, 1) = intN2) Or (B(X, 2) = intN2) Or (B(X, 3) = intN2) Or (B(X, 4) = intN2) Or (B(X, 5) _
= intN2)) Then Compteur(intN1, intN2) = (Compteur(intN1, intN2) + 1)
If intN2 = 50 Then GoTo suite3
Next intN2
suite3:
If intN1 = 50 Then GoTo suite4
Next intN1
suite4:
If X = C1 Then GoTo suite5
Next X
suite5:
Open "EUROMILLIONS\EURO_MILLIONS/A_Partir_Résultats/Affinités_EuroMillions.xls" For Output As #1
C = X
For intN1 = 1 To 50
For intN2 = 1 To 50
Print #1, intN1, intN2, Compteur(intN1, intN2)
Next intN2
Next intN1
Print #1, C
Close #1
End Sub "
La dernière fois qu'elle a bien fonctionné était le 30 décembre dernier.
Depuis le 3 janvier 2003 elle bloque sur :
=> Open "EUROMILLIONS\EURO_MILLIONS/A_Partir_Résultats/Affinités_EuroMillions.xls" For Output As #1
=> Sans aucun message d'erreur.
=> "Ctrl + Pause" inefficace pour l'arrêter.
=> Seule solution "Ctrl + Alt + Suppr" pour déconnexion.
Quelle(s) explication(s) ?
Quelle(s) solution(s)
Grands mercis.
Bien cordialement