Bonjour,

J'ai une macro pour tester si un fichier exists, cette macro fonctionne avec Excel 2003 mais pas sous 2007
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
Public Function FileExisting(chemin, nom As String) As Boolean
exists = False
Set fs = Application.FileSearch
    With fs
        .LookIn = chemin
        .FileType = msoFileTypeAllFiles
        If .Execute > 0 Then
           For i = 1 To .FoundFiles.Count
 
                If InStr(.FoundFiles(i), nom) > 0 Then
                    exists = True                
                End If
            Next i
        End If
    End With
FileExisting = exists
End Function
Avez vous une solution à me proposer pour la remplacer en sachant que la migration de tous nos PC n'est pas encore terminée et donc cette macro doit fonctionner avec Excel 2003 et 2007

J'ai juste besoins de savoir si oui ou non le fichier "chemin+nom" exists rien de plus

Par avance merci de votre aide