File exists under directory

G

Guest

This will work for you assumimng you meant the windows directory and not all
subdirectories. Place it in a standard code module...

Public Function FileExists(ByVal FileName As String) As Boolean
FileExists = CBool(Len(Dir("C:\Windows\" & FileName)))
End Function
 
P

PeterW

Hi

I am trying to put together a report in excel that shows whether or no
certain files exist under the windows directory.

By concatenating a number of fields I produce the name of the file
would like to check if it exists. If it exists I want the cell t
return TRUE and if not FALSE.

I think I will need a UDF to do this as I want to copy the formula t
other cells that are concatenating other filenames to check.

Any help would be appreciated.

Pete
 

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