Sub LirePlage(ByVal Plage As Range, Optional ByVal CelHeure As Range, Optional ByVal Abandonner As Boolean = True)
Dim Chemin As String, DatHMàJ As Date, DatHFic As Date, Te() As String, Ts(), Ls As Long, Z As String, C As Long
Chemin = ThisWorkbook.Path & "\Communication"
ChDrive Chemin
If Not CelHeure Is Nothing Then
DatHMàJ = CelHeure.Value
Do: DatHFic = FileDateTime("TableauCentral.txt")
If DatHFic > DatHMàJ Then Exit Do
If Abandonner Then Exit Sub
DoEvents: Loop
CelHeure.Value = DatHFic: End If
ReDim Ts(1 To 50000, 1 To 100)
Open "TableauCentral.txt" For Input Access Read As #1
While Not EOF(1)
Line Input #1, Z: Te = Split(Z, vbTab)
If UBound(Te) + 1 > UBound(Ts, 2) Then ReDim Preserve Ts(1 To 50000, 1 To UBound(Te) + 1)
For C = 0 To UBound(Te)
Ls = Ls + 1
If Left$(Te(C), 1) = """" Then
Ts(Ls, C + 1) = Replace$(Mid$(Te(C), 2, Len(Te(C)) - 1), """""", """")
ElseIf IsNumeric(Te(C)) = "" Then
Ts(Ls, C + 1) = CDbl(Te(C))
End If: Next C
Close #1: Wend
Plage.ClearContents
Plage.Resize(Ls, UBound(Ts, 2)).Value = Ts
End Sub