Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Vlookup return most recent date (value) | Excel Discussion (Misc queries) | |||
lookup part number in a vertical list and return the most recent . | Excel Discussion (Misc queries) | |||
formula to return date of most recent update | Excel Worksheet Functions | |||
FileSearch & .zip file | Excel Programming | |||
Find Correct Subdirectory | Excel Programming |