Find the file date and time for another excel file

storm925

Board Regular
Joined
Jan 20, 2010
Messages
226
Hello All,
I'm looking for a formula or simple macro that will let me find the date and time of another excel file and post it into the cell of an open worksheet.

Example:
In cell "L1" of the current opened worksheet, I want to paste the "directory" date and time for the following file... J:\Control\NightCount.csv

Thanks,
Ben
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
After querying the web, I found my answer. I thought I would share it here in case someone searches for it through this forum.

Here is a simple macro to find the creation date of the current opend file...

Sub Open_File_Creation_Date()
Range("L1").Select
ActiveCell.Value = _
Application.ActiveWorkBook.BuiltinDocumentProperties("Creation Date")
End Sub

Here is what I was looking for, a simple macro to find the date and time of another file...

Sub Another_File_Creation_Date()
Range("L1").Select
ActiveCell.Value = _
FileDateTime("J:\Control\NightCount.csv")
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,749
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top