使用VBA循环遍历文件夹中的文件?
file.name
工作但速度太慢的代码(每100个文件15秒):
Sub LoopThroughFiles() Dim MyObj As Object, MySource As Object, file As Variant Set MySource = MyObj.GetFolder("c:\testfolder\") For Each file In MySource.Files If InStr(file.name, "test") > 0 Then MsgBox "found" Exit Sub End If Next fileEnd Sub
解决问题:
Dir
FileDateTime
.
天涯尽头无女友
湖上湖
慕容708150