A
answer33
I just switch from Windows XP to Windows 2007 and I'm no longer able to run
this macro.
Can you help me...
Thanks
-----------------------------------------------
Sub ListFiles_01()
'Using FileSearch to list the files in a directory
Dim i As Integer
i = 1
With Application.FileSearch 'This is the problem'
..NewSearch
..LookIn = "C:\"
..Filename = "*.*"
.SearchSubFolders = True
'.SearchFolders = True
..Execute
For i = 1 To .FoundFiles.Count
Range("B" & i + 1).Value = .FoundFiles(i)
Range("C" & i + 1).Value = FileDateTime(.FoundFiles(i))
Range("D" & i + 1).Value = FileLen(.FoundFiles(i))
'Range("E" & i + 1).Value = Filename(.FoundFiles(i))
Next
End With
End Sub
this macro.
Can you help me...
Thanks
-----------------------------------------------
Sub ListFiles_01()
'Using FileSearch to list the files in a directory
Dim i As Integer
i = 1
With Application.FileSearch 'This is the problem'
..NewSearch
..LookIn = "C:\"
..Filename = "*.*"
.SearchSubFolders = True
'.SearchFolders = True
..Execute
For i = 1 To .FoundFiles.Count
Range("B" & i + 1).Value = .FoundFiles(i)
Range("C" & i + 1).Value = FileDateTime(.FoundFiles(i))
Range("D" & i + 1).Value = FileLen(.FoundFiles(i))
'Range("E" & i + 1).Value = Filename(.FoundFiles(i))
Next
End With
End Sub