application.filesearch error in excel 2007

R

Ramesh

While running an old macro using application.filesearch I am getting some
maco error in excel 2007. The code is

Set fs = Application.FileSearch
With fs
.LookIn = szRepIn
.Filename = rng.Offset(i, 1).Value
.MatchTextExactly = True
If .Execute(SortBy:=msoSortByFileName,
SortOrder:=msoSortOrderAscending) = 0 Then
rng.Offset(i, 2).Value = "File not found"
End If
End With

The error is being raised at line Set fs = Application.FileSearch

Please help me. I am a newbie to excel.

Thanks
Ramesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top