Public Const prem_lign = 2
Public Const prem_col = 0
Public chemin, A, B, C, D, E, F, G, H As String
Public i, s As Integer
Public repertoire_base_scan, arret As Boolean
Public repertoire()
Public Const O_synth = "Synthèse"
Public Const O_trav = "travail"
Public Const O_ind = "index"
Public Const O_trifichier = "trifichier"
Public Const O_sup = "support"

Sub traitement()
Dim repertoire_depart As String
Dim ligne_fiche As Integer
Dim WbK As Workbook


repertoire_depart = folder_query
If repertoire_depart = "FAUX" Then GoTo fin

Application.ScreenUpdating = False
C = ActiveWorkbook.Name

Sheets(O_sup).Visible = True
Sheets(O_sup).Copy
Workbooks(C).Sheets(O_sup).Visible = False
A = ActiveWorkbook.Name
Workbooks(A).Sheets.Add after:=Workbooks(A).Sheets(O_sup)
Application.DisplayAlerts = False
    Workbooks(A).Sheets(1).Name = O_synth
    Workbooks(A).Sheets(2).Name = O_trav
    Workbooks(A).Sheets(O_synth).Activate
Application.DisplayAlerts = True

ligne_fiche = prem_lign + 1

'scan des répertoires
chemin = repertoire_depart & "\"
s = 1
ReDim Preserve repertoire(s)
repertoire(0) = repertoire_depart

lance_barre_scan
repertoire_base_scan = True
liste_repertoire (chemin)
decharge_barr_scan
 
lance_barre_reporting

inc_bar_fich (0)
inc_bar_rep (0)
'<<<Lister les fichier des repertoire>>>
For G = 0 To s - 1
    inc_bar_fich (0)
    Set fs = Application.FileSearch
    With fs
        .LookIn = repertoire(G)
        .Filename = "*.xls"
        .Execute
        j = .FoundFiles.Count
            For i = 1 To j
                If controle(.FoundFiles(i)) Then
                    Set WbK = OuvreFichier(.FoundFiles(i))
                    If Not (WbK Is Nothing) Then
                        B = ActiveWorkbook.Name
                        Application.DisplayAlerts = False
                        ActiveSheet.Cells.Copy (Application.Workbooks(A).Worksheets(O_trav).Cells)
                        Application.Workbooks(A).Worksheets(O_trav).Range("A1").Value = "" & .FoundFiles(i)
                        Workbooks(B).Close
                        DoEvents
                        Application.DisplayAlerts = True
                        récupération_données (ligne_fiche)
                    Else
                        Worksheets(O_synth).Cells(ligne_fiche, prem_col + 1).Select
                        Worksheets(O_synth).Hyperlinks.Add Anchor:=Selection, Address:=.FoundFiles(i)
                        Worksheets(O_synth).Cells(ligne_fiche, prem_col + 2).Value = "PROTEGE"
                        Worksheets(O_synth).Cells(ligne_fiche, prem_col + 1).Value = .FoundFiles(i)
                    End If
                    ligne_fiche = ligne_fiche + 1
                End If
                inc_bar_fich (i / j)
            Next i
    End With
    inc_bar_rep ((G + 1) / s)
Next

On Error Resume Next
decharge_barr

Application.DisplayAlerts = False
    Workbooks(A).Sheets(O_trav).Delete
Application.DisplayAlerts = True
Worksheets(O_synth).Activate
mise_en_forme
Range("A1").Select
Application.ScreenUpdating = True
Exit Sub



fin2:
Application.DisplayAlerts = False
    Workbooks(A).Close
Application.DisplayAlerts = True
fin:
Application.ScreenUpdating = True
End Sub