File exists under directory

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top