We help IT Professionals succeed at work.

FILE DATE

Serena2345
Serena2345 asked
on
Medium Priority
171 Views
Last Modified: 2012-03-26
How do I find out if a file we use on the C\drive is today's date Id not stop the user
Comment
Watch Question

Author

Commented:
How do I find out if a file we use on the C\drive is today's date If not stop the user

sorry about the typo
Retired
CERTIFIED EXPERT
Top Expert 2012
Commented:
Don't quite know what you want to do about it, but this shows how to use VBA to check the file date:

Dim strMyFile As String
strMyFile = "C:\MyFolder\MyFile.txt"
If DateDiff("d", Now, FileDateTime(strMyFile)) <> 0 Then
    MsgBox "This is not today's file"
End If

Explore More ContentExplore courses, solutions, and other research materials related to this topic.