Modification de Application.filesearch sous Excel 2007
Bonjour à tous,
Travaillant auparavant avec Excel 2003, j'avais trouvé une macro me permettant de récupérer plusieurs données inscrites dans différents fichiers excel.
Une fois passé à Excel 2007, l'application Filesearch n'est plus reconnue par Excel 2007 et la macro plante sur le "With Application.FileSearch".
Y aurait-il une âme charitable qui pourrait m'aider à retranscrire cette macro pour utilisation sous Excel 2007?
Merci d'avance pour votre aide.
ex:
Code:
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
| Sub DONNEES_OCTOBRE()
'
X = 112
Do While Cells(X, 1) <> "99999"
Set c = Cells(X, 3)
Cells(X, 4).Value = c
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\FREZZASE\Bureau\DCS\FEUILLES ROSES\10-2008\TOT"
.FileType = msoFileTypeExcelWorkbooks
.Filename = c
If .Execute > 0 Then
Workbooks.Open Filename:=.FoundFiles(1)
Workbooks("CHIFFRES RAPPORT TEST2.xls").Worksheets("DONNEES").Cells(X, 5).Value = Cells(21, 7).Value
Workbooks("CHIFFRES RAPPORT TEST2.xls").Worksheets("DONNEES").Cells(X, 6).Value = Cells(23, 7).Value
Workbooks("CHIFFRES RAPPORT TEST2.xls").Worksheets("DONNEES").Cells(X, 7).Value = Cells(25, 7).Value
For Each w In Workbooks
If w.Name <> ThisWorkbook.Name Then
w.Close savechanges:=False
End If
Next w
Else: MsgBox "Pas de fichier trouvé pour " & c
End If
End With |