Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping through each directory
Sub tester2()
With Application.FileSearch .NewSearch .LookIn = "C:\My Documents" .SearchSubFolders = True .Filename = ".xls" .MatchTextExactly = True .FileType = msoFileTypeExcelWorkbooks If .Execute() 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." For i = 1 To .FoundFiles.Count MsgBox .FoundFiles(i) Next i Else MsgBox "There were no files found." End If End With End Sub Pretty much does what you describe including the find files. You may have to use it to get a gross list, then loop the list (.foundfiles) to cull out the substrings you want. Regards, Tom Ogilvy "Steven Revell" wrote in message ... Hi all, I'm looking for a way to loop through all the directories on a server and run find files (without subdirectory searching). I would like it to run on Excel 97 but Excel 2000 will be fine. So my questions is does anyone know how to run through all the subdirectories within a directory. And, if those directories have sub directories then go through them as well. thanks for any help, Steven |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping through each directory
Cheers guys,
My problem is that there are a lot of files and filesearch can only do a maximum of 65000 or so. There are about 2 million and so thats why i need to do a find files on each separate directory. Thanks, Steven Revell Applications Development & Support *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looping | Excel Discussion (Misc queries) | |||
Not Looping | Excel Discussion (Misc queries) | |||
Looping macro | Excel Worksheet Functions | |||
Looping | Excel Discussion (Misc queries) | |||
Looping through each directory | Excel Programming |