You could use the FileSystemObject:
http://support.microsoft.com/kb/185601
http://www.vb-helper.com/howto_list_...hierarchy.html
http://www.vbaexpress.com/kb/getarticle.php?kb_id=232
for more:
http://www.google.com/search?ie=UTF-...ory+search+fso
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -
http://PeltierTech.com
_______
"Amery" <(E-Mail Removed)> wrote in message
news:CA7EA664-E487-4CA0-A1F2-(E-Mail Removed)...
>I have a batch of code that works for any computer with 2003 or earlier
> versions, and I have been told by 2007 that it no longer is allowed.
> Here's
> the code..
>
> dim fs as variant
> Set fs = Application.FileSearch
> With fs
> .LookIn = Sheet2.Cells(6, 4)
> .Filename = "*.xls"
> If .Execute(SortBy:=msoSortByFileName,
> SortOrder:=msoSortOrderAscending)
>> 0 Then
> end if
> End With
>
> The code breaks at the set command and says something regarding the fact
> that 2007 no longer supports the method or object. Does anyone know of a
> way
> to get this to work in Excel '07?