Ron de Bruin provides a couple of alternatives to .filesearch here:
http://www.rondebruin.nl/fso.htm
and
http://www.rondebruin.nl/copy3.htm
On 08/28/2011 13:39, OP wrote:
> Hi there,
>
> I guess the subject has already been raised a thousand times, but I am
> at lost wirth my macro. Of course everything worked well with Excel
> 2003; but as Filesearch has been removed from 2010 I can't really find a
> clue to solve my problem. I looked over a couple of forums for a
> filescript substitute but found nothing simple enough for me to
> understand.
>
> Here is my problem :
>
> I have variables, (Fpath and Fname) that I run through the Filesearch
> funtion. That returns me a single filename (Fil) that I use to copy to a
> another folder... See the code below.
>
> Would appreciate if anybody could help me to master this under 2010.
>
> Thanks
>
>
> With Application.FileSearch
> .NewSearch
> .LookIn = FPath
> .SearchSubFolders = True
> .Filename = fName
> If .Execute(SortBy:=msoSortByFileName, _
> SortOrder:=msoSortOrderAscending)> 0 Then
> Fil = .FoundFiles(1)
> Else
> MsgBox "There were no files found."
> Exit Sub
> End If
> End With
> FileCopy Fil, dest + fName
--
Dave Peterson