Displaying last saved date
Eliminate Pivot Table Annoyances
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Displaying last saved date

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    10
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-15 00:59, JohnnyC wrote:
    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
    Try this function that uses the FileSytem Object


    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





    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    10
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thanks Ivan, that's perfect.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com