Sub listeFichiersXLS()
'necessite d'activer la reference Microsoft Shell Controls and Automation
'Menu Outils
'References
'cocher la ligne 'Microsoft Shell Controls and Automation'
''cliques sur OK pour valider'
'
Dim objShell As Shell
Dim strFileName As FolderItem
Dim objFolder As Folder
Dim i As Integer
Dim Chemin As String
Chemin = 'C:\\Documents and Settings\\michel\\dossier\\general\\excel'
Set objShell = CreateObject('Shell.Application')
Set objFolder = objShell.NameSpace(Chemin)
For Each strFileName In objFolder.Items
If strFileName.Type = 'Feuille de calcul Microsoft Excel' Then
i = i + 1
Cells(i, 1) = objFolder.GetDetailsOf(strFileName, 0)
Feuil1.Hyperlinks.Add Anchor:=Cells(i, 1), Address:=Chemin & '\\' & _
objFolder.GetDetailsOf(strFileName, 0)
End If
Next strFileName
End Sub