B
BTW
Hi there,
I have a macro with the following code in there:
It is searching for the last modified file between now, and 3 quarters
back. But, Excel returns an error...
this is my code:
GetDate = Now
GetDate2 = GetDate - 0.03
With Application.FileSearch
.LookIn = TSV_File_Path
.Filename = "*.tsv"
.PropertyTests.Add Name:="LastModified", _ (***Here is
generates an error***)
Condition:=msoConditionAnytimeBetween, _
Value:=GetDate2, _
SecondValue:=GetDate, _
Connector:=msoConnectorOr
.Execute
If .FoundFiles.Count <> 0 Then
For i = 1 To .FoundFiles.Count
FoundedFilename = .FoundFiles(i)
Next i
Workbooks.OpenText Filename:=FoundedFilename
Excel_TSV_file = Application.ActiveWorkbook.Name
Else
MsgBox " No files found", vbOKOnly
End If
End With
Why doens't it work? can somebody help me out?
I have a macro with the following code in there:
It is searching for the last modified file between now, and 3 quarters
back. But, Excel returns an error...
this is my code:
GetDate = Now
GetDate2 = GetDate - 0.03
With Application.FileSearch
.LookIn = TSV_File_Path
.Filename = "*.tsv"
.PropertyTests.Add Name:="LastModified", _ (***Here is
generates an error***)
Condition:=msoConditionAnytimeBetween, _
Value:=GetDate2, _
SecondValue:=GetDate, _
Connector:=msoConnectorOr
.Execute
If .FoundFiles.Count <> 0 Then
For i = 1 To .FoundFiles.Count
FoundedFilename = .FoundFiles(i)
Next i
Workbooks.OpenText Filename:=FoundedFilename
Excel_TSV_file = Application.ActiveWorkbook.Name
Else
MsgBox " No files found", vbOKOnly
End If
End With
Why doens't it work? can somebody help me out?