![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 10
|
I've got a macro that loads data out of a text file into an Excel spreadsheet and I need to find out the last modified date of this file. Is there a function i can use that displays this, or can you find out the information in VBA?
As usual the Excel help file isn't helpful. Thanks |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
Function LastMod(SFileFullName As String) '// Finds the Files last modified Date/Time '// Use: =LastMod("C:readme.txt") '// Returns: Last Modified:= dd/mm/yy hh:mm:ss '// : Depending on system time format setup Dim Fso, F Set Fso = CreateObject("Scripting.FileSystemObject") Set F = Fso.GetFile(SFileFullName) LastMod = "Last Modified:= " & F.DateLastModified End Function |
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 10
|
Thanks Ivan, that's perfect.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|