-
Solved: FileSearch
Hello, I'm having a problem using the FileSearch property. I get an error message on the third line of the following code which says that the object doesn't admit the property. I took the code from a post I read. Any idea how can I solve this problem? Thanks in advance.
[vba]Sub openAllfilesInALocation()
Dim i As Integer, wb As Workbook
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\jmortsev\Mis documentos\Proyectos\Michael Lacroix"
.SearchSubFolders = False
.Filename = "*.xls"
.Execute
For i = 1 To .FoundFiles.Count
Set wb = Workbooks.Open(Filename:=.FoundFiles(i))
wbResults.Close SaveChanges:=False
Next i
End With
End Sub
[/vba]
-
Filesearch has been deprecated in xl 2007 up.
Explore fileSystemObject perhaps.
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules