Are you using Excel 2007? If you are change .xls to the relevant 2007 extension
Option Explicit
Sub Lis_All_Files()
Dim sFil As String
Dim sPath As String
Dim r As Long
sPath = "C:\Documents and Settings\Roy Cox\My Documents\" 'location of files
ChDir sPath
sFil = Dir("*.xls") 'change or add formats
r = 2
Do While sFil <> "" 'will start LOOP until all files in folder sPath have been looped through Set oWbk = Workbooks.Open(sPath & "\" & sFil) 'opens the file
With ActiveSheet
.Cells(r, 1).Value = sFil
r = r + 1
End With
sFil = Dir
Loop ' End of LOOP
End Sub
Bookmarks