检查文件夹中所有CSV文件的上次保存date

真的很简单,我想。 我怎样才能修改下面的内容,而不是看LOI.CSV它在Intraday文件夹中查看所有.CSV文件?

LastSaved = FileDateTime("W:\Settlements\Intraday\LOT.csv") If LastSaved < Date Then MsgBox ("The current day file for LOI was last saved " & LastSaved) End If 

尝试这个

 Const sPath As String = "W:\Settlements\Intraday\" Sub LoopThroughFilesInAFolder() Dim StrFile As String StrFile = Dir(sPath & "\*.Csv") Do While Len(StrFile) > 0 Debug.Print FileDateTime(sPath & "\" & StrFile) '~~> Rest of the code here StrFile = Dir Loop End Sub