2007 Compatability

J

Jeff

Hi,

I have a function written in Excel 2003:

Sub Check_if_files_exist(path, fname, fileexists2)

With Application.FileSearch
.NewSearch
.FileName = fname
.LookIn = path
.Execute

If .FoundFiles.Count >= 1 Then
fileexists2 = 1 'The File exists
Else
fileexists2 = 0 'The file does not exist
End If

End With

End Sub

The problem is that someone with 2007 cant use this because it does not
recognize
With Application.FileSearch. Is there another command that is compatable in
both 2003 and 2007?

Thanks
 

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