Bonjour,

Je vous soumet cette procédure pour savoir si quelqu'un aurait une idée pour accelerer le traitement.

Pour info le fichier fait au minimum 4000 lignes

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
    Private Sub BTsupp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTsupp.Click
        Dim resul As MsgBoxResult
        Dim i, j As Integer
        Dim col As String
        resul = MessageBox.Show("Vous êtes sur le point de supprimer la fiche active, confirmez SVP", "SUPPRESSION DE LA FICHE ACTIVE", MessageBoxButtons.OKCancel)
 
        If resul <> 1 Or nfich = 0 Then
            Exit Sub
        Else
            col = collec & "Tempo"
 
 
            Windows.Forms.Cursor.Current = Cursors.WaitCursor
 
            For i = indexfich To indexmax - 1
                FileGet(nfich, enreg, i + 1)
                FilePut(nfich, enreg, i)
            Next
 
            indexfich = 0
            FileOpen(101, col, OpenMode.Random, , , lg)
            For j = 1 To indexmax - 1
                FileGet(nfich, enreg, j)
                FilePut(101, enreg, j)
                indexfich = indexfich + 1
            Next
            indexmax = indexfich
            FileClose()
            My.Computer.FileSystem.DeleteFile(collec)
            My.Computer.FileSystem.RenameFile(col, nomcol(UBound(nomcol)))
        End If
        Windows.Forms.Cursor.Current = Cursors.Default
        nfich = FreeFile() : FileOpen(nfich, collec, OpenMode.Random, , , lg)
        rafraichissement()
    End Sub