Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps the FileSearch object. This is basically the code in the help file
for the filesearch object. With Application.FileSearch .NewSearch .LookIn = "C:\My Documents" .SearchSubFolders = False .FileName = ".xls" ' .MatchTextExactly = True .FileType = msoFileTypeAllFiles If .Execute() 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." For i = 1 To .FoundFiles.Count ' MsgBox .FoundFiles(i) set wkbk = workbooks.Open(.foundfiles(i)) ' work on the workbook wkbk.close Savechanges:=False ' or true Next i Else MsgBox "There were no files found." End If End With-- Regards,Tom Ogilvy"John Acocella" wrote in message ... I want to retrieve the file names of excel files in a specific directory, retrieveing them one at a time through a looping routine. Is there any way to do this in Excel besides using the DIR function? I thought I read something in the Microsoft knowledge base, but I can't find it. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you set Excel 2007 to open files in a specific folder? | Excel Discussion (Misc queries) | |||
can't open excel files from common folder | Excel Discussion (Misc queries) | |||
Can't Open Certain Excel Files in Folder | Excel Discussion (Misc queries) | |||
Open Excel files in a folder | Excel Programming | |||
open all files in a folder and ... | Excel Programming |