View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default validate a directory or file exits

if dir("C:\Myfolder\Myfile.xls") = "" then
msgbox "It doesn't exist"
exit sub
Else
workbooks.Open c:\Myfolder\Myfile.xls"
End if

--
Regards,
Tom Ogilvy


"Simon Shaw" wrote in message
...
How do I validate if a file exists without using On Error Resume Next then
trying to open it?