View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_14_] Bob Phillips[_14_] is offline
external usenet poster
 
Posts: 216
Default Opening a file with date extension

You could do a Dir before opening to get the full file name

sFilename = Dir("C:\Test\My Import File*.xls"

note that this will return the first found if there are many.

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"JohnUK" wrote in message
...
Hi,
I have a workbook that opens a file, imports data and closes it down

again.
The problem I have or will have:
The file that holds the data will change the name by having a date added,

so
this will now mean I will have to manualy open the file and minus off the
date so that I can import.
Is there a way the macro can ignore the date so that it would still open

the
file and import the data?
Again - your support is greatly appreciated
John