我认为非常简单的问题。如何修改下面的内容,以便查看LOI.CSV而不是查看日内文件夹中的所有.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
答案 0 :(得分:3)
试试这个
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