Thread: Dir function
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Dir function

What was the exact full path of that file?

RBS


"Alok" wrote in message
oups.com...
Friends,

I have been using the following function for Checking if the file
exists.

Public Function FileExists(ByVal sPathAndFileName$)as boolean
FileExists = (Dir(sPathAndFileName)<"")
End Function

Today for the first time I found that the function worked if the
filename part passed to the function matched the case of the file
stored in the folder but did not work if the capitalization was not
correct. I beleive that the Dir function is not case sensitive. What is
happening then?

Thanks.

Alok