【发布时间】:2011-09-19 14:28:41
【问题描述】:
我正在寻找一种使用 VBA 在 Excel 2010 中执行此操作的方法。
过去在 Excel 2003 中使用 Application.FileSearch 方法是可能的,但它已被贬低。 (见下文)
Dim sFileName As String
sFileName = ""
With Application.FileSearch
.NewSearch
.LookIn = sDir
.Filename = "*.*"
.Execute msoSortByLastModified, msoSortOrderDescending
If .FoundFiles.Count > 0 Then sFileName = .FoundFiles(1)
End With
任何想法如何在 Excel 2010 中执行此操作?
谢谢
【问题讨论】:
标签: excel vba excel-2010 file-search