Hi,
I used filesearch to detect zip file but it does not seems to work. Can someone teach me where did I do wrong in my code please?
I used filesearch to detect zip file but it does not seems to work. Can someone teach me where did I do wrong in my code please?
Code:
Dim i As Integer
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.getfolder(DatabaseDir)
'Start import
With Application.FileSearch
.NewSearch
.LookIn = f.Path
.SearchSubFolders = False
.filename = "*.zip"
.MatchTextExactly = False
.FileType = 1 'msoFileTypeAllFiles
.Execute
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
' Dim RaName As String
' RaName = Unzip(.FoundFiles(i))
Next i
End With
End Function