LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Return most recent file in subdirectory with out using FileSearch

The file search object does not work properly on all platforms. This is a
known issue but the workarounds provided in article 305342 do not resolve the
problem when using a local hard drive mapped to €œK:€. I need
recommendations for returning the most recent file in a subdirectory with out
using the FileSearch object.

The following code works as expected except when using Office XP with
Windows 2000.
------------------------------------------------------------------------------
With Application.FileSearch
..Newsearch
..Lookin = €œK:\€
..SearchSubFolders = false

NumFound = .Execute(SortBy: msoSortByLastModified, _
SortOrder: = msoSortOrderDescending _
AlwaysAccurate = True)

If NumFound 0 then NewestFile = FilesFound(1)
-------------------------------------------------------------------------------

I need code that works on any combination of Office 2000 and above with
Window 2000 and above. The code above is generic and I will actually be
using a function.

Thanks

 
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
Vlookup return most recent date (value) ryanholliday Excel Discussion (Misc queries) 9 May 3rd 23 11:44 AM
lookup part number in a vertical list and return the most recent . James T[_2_] Excel Discussion (Misc queries) 4 August 28th 07 09:07 PM
formula to return date of most recent update Paul Excel Worksheet Functions 0 March 29th 07 02:10 AM
FileSearch & .zip file keepITcool Excel Programming 0 April 14th 05 12:27 AM
Find Correct Subdirectory Stratuser Excel Programming 1 November 15th 04 11:56 PM


All times are GMT +1. The time now is 11:37 AM.

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

About Us

"It's about Microsoft Excel"