View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JohnUK JohnUK is offline
external usenet poster
 
Posts: 173
Default Opening a file with date extension

Hi Ivan,
Thanks for coming in as well.
I have tried your code, but what extra piece of code do I need to actualy
open the file once found?
John

"Ivan Raiminius" wrote:

Hi,

Dir doesn't return the full path, so you have to use something like
this:

sPath = "C:\test"
sFilename = "My Import File*.xls"
if len(dir(spath & "\" & sfilename))=0 then
msgbox "No file"
else
sFilename = spath & "\" & dir(spath & "\" & sfilename)
end if

Regards,
Ivan