我正在寻找一种使用 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 中执行此操作?
谢谢