+ Reply to Thread
Results 1 to 6 of 6

modification date for a file

Hybrid View

neta modification date for a file 05-05-2009, 11:47 AM
Leith Ross Re: modification date for a... 05-05-2009, 12:06 PM
neta Re: modification date for a... 05-05-2009, 12:15 PM
Leith Ross Re: modification date for a... 05-05-2009, 12:18 PM
neta Re: modification date for a... 05-05-2009, 12:22 PM
Leith Ross Re: modification date for a... 05-05-2009, 12:31 PM
  1. #1
    Registered User
    Join Date
    03-26-2004
    Posts
    35

    modification date for a file

    hi,
    How can I retreive into a VBA code the date of the last modification of a different excel file ?
    Can I retreive rhe name of the execel file creator ?

    Thanks, Neta

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: modification date for a file

    Hello neta,

    Here is an example using the File System Object. This works with Excel 2000 and up.
    Sub Macro1()
    
      Dim FileName As String
      Dim FSO AS Object
      Dim LastMod As Variant
    
        FileName = " "  'Add the Workbook name along with the path between the quotes
    
        Set FSO = CreateObject("Scripting.FileSystemObject")
        LastMod = FSO.GetFile(FileName).DateLastModified
    
        Set FSO = Nothing
    
    End Sub
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    03-26-2004
    Posts
    35

    Re: modification date for a file

    Thanks a lot...
    Can I have the file creator ?

    Neta

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: modification date for a file

    Hello neta,

    If you are referring to the "Creator" property, this is only available on the MAC version of Excel.

  5. #5
    Registered User
    Join Date
    03-26-2004
    Posts
    35

    Re: modification date for a file

    Thanks a lot,

    What are the available properties in the PC Excel ?

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: modification date for a file

    Hello neta,

    On the PC, there is no way to know what program created the file. The assumption would be it was created by the application for the file type. In the case of a workbook, it would be Excel.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1