I am using the following to get the path and name of a file to open:
Because I know the beginning name of the file, I need only to open a file with a given creation date value. For example, there are multiple log files: file1.csv, file2.csv, file3.csv... Using the code above I would see all files and without dates. I want the user to only enter the date. Say, I want to open the log file that was created on a day last week. The VBA code would open all the log files for the given date and import them into Excel.
Here is my pseudo code:
Code:
StrFileName = Application.GetOpenFilename(FileFilter:="CSV Files (*.csv),*.csv", _
Title:="Select File To Open")
Here is my pseudo code:
Code:
Open StrFileName In StrFolderPath.Files Where _
StrFileName.DateCreated Is StrDate