Posted on 2012-03-09
Medium Priority
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
Question by:Serena2345

Author Comment

ID: 37702462
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
LVL 77

Accepted Solution

GrahamSkan earned 2000 total points
ID: 37702844
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
What to do if a split doesn't fit? Or a bunch of invoice lines must be rounded while the sum must match a total? It takes a little, but - when done - it is extremely easy to implement.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question