View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alex St-Pierre Alex St-Pierre is offline
external usenet poster
 
Posts: 169
Default Verify if filename is valid

Hi,
I need to say if a specific path refer to a valid file. It tried to use the
function below but it give true if the directory is valid.
ex:
myFileName = "C:\Temp" should answer false (all the time)
myFileName = "C:\Temp\Test.xls" should answer true (if file exist)

I tried that but doesn't work.
Len(Dir$((myFileName,vbdirectory)
Len(myFileName)
CBool(Len(Dir(myFileName)))

Thanks
--
Alex St-Pierre