H
Hari
Hi,
I am looking to get the list of excel files in a folder through VBA.
By browsing the net i found this
Sub Search_files()
Dim FileS As FileSearch
Dim F As Variant
Dim x As Integer
Set FileS = Application.FileSearch
With FileS
.NewSearch
.Filename = InputBox("Insert file name")
.LookIn = InputBox("Insert the path")
.SearchSubFolders = True
.Execute
End With
x = 1
For Each F In Application.FileSearch.FoundFiles
Cells(x, 1) = F
x = x + 1
Next F
End Sub
When the cursor goes to "Set FileS = Application.FileSearch" it says
the OBJECT DOESN'T SUPPORT THIS ACTION"
Kindly provide solution
Thanks'
Hari
I am looking to get the list of excel files in a folder through VBA.
By browsing the net i found this
Sub Search_files()
Dim FileS As FileSearch
Dim F As Variant
Dim x As Integer
Set FileS = Application.FileSearch
With FileS
.NewSearch
.Filename = InputBox("Insert file name")
.LookIn = InputBox("Insert the path")
.SearchSubFolders = True
.Execute
End With
x = 1
For Each F In Application.FileSearch.FoundFiles
Cells(x, 1) = F
x = x + 1
Next F
End Sub
When the cursor goes to "Set FileS = Application.FileSearch" it says
the OBJECT DOESN'T SUPPORT THIS ACTION"
Kindly provide solution
Thanks'
Hari