Re : recuprere files avec liste lien ds excel
Bonjour
bon un ami m`a aide a trouver la solution.
je la mets a dispo, ca peut servir a d`autres.
Bonne journee
Sub CopyAllFilesToDir()
Dim filepath, out, dir As String
dir = "C:\Documents and Settings\Macro\"
'chemin ou je veux recuperer les files que je capture
Set fs = CreateObject("Scripting.FileSystemObject")
With Workbooks("Liste_liens.xls").Sheets("Sheet1")
'Liste_Liens est le nom du fichier ou on m`a liste les liens - liens ds colonne c
For i = 1 To .Cells(1, 1).End(xlDown).Row
filepath = .Cells(i, 3).Value 'Path in 3rd Column
If fs.FileExists(filepath) Then
out = dir + Right(filepath, Len(filepath) - InStrRev(filepath, "\"))
fs.CopyFile filepath, out 'Copy
End If
Next i
End With
End Sub