LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Opening file with date tags

Great it works

Many thanks colofnature

Also thanks to Tom - I will try yours later

Must leave now.........

"" wrote:


Replace the line

Set wb = Workbooks.Open(sfilename)

with the following:

sfilename = sPath & "\" & Dir(sPath & "\" & sfilename)
NewestFileName = sfilename
FileDate = FileDateTime(sfilename)
Do While Len(sfilename) Len(sPath & "\")
If FileDateTime(sfilename) FileDate Then
NewestFileName = sfilename
FileDate = FileDateTime(sfilename)
End If
sfilename = sPath & "\" & Dir()
Loop
Set wb = Workbooks.Open(NewestFileName)

I haven't tested it, but it ought to work... :)
Col


--
colofnature
------------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
View this thread: http://www.excelforum.com/showthread...hreadid=544793


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a file with date extension JohnUK Excel Programming 13 May 22nd 06 12:30 PM
Opening file saved as current date Yepp12[_2_] Excel Programming 3 December 13th 05 02:59 PM
switched date format opening dbf file [email protected] Excel Programming 1 July 16th 04 01:13 PM
Date format when opening a .CSV file programmatically jason Excel Programming 3 November 10th 03 09:09 AM
Opening CSV file causes date differences Tom Ogilvy Excel Programming 0 August 6th 03 12:26 AM


All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"