• File Data (v2000)

    Author
    Topic
    #413688

    How can I pull the ‘Date Modified’ date on a specific file? For instance, C:Test.xls was modified on 12/17/2004…how can I retrieve that date?
    Thanks!
    Dashiell

    Viewing 1 reply thread
    Author
    Replies
    • #914460

      You can use code like this:

      Debug.Print CreateObject(“Scripting.FileSystemObject”).GetFile(“C:Test.xls”).DateLastModified

      This doesn’t require you to set a reference. If you want more control, set a reference (in Tools | References) to Microsoft Scripting Runtime, and use code like this:

      Dim fso As New Scripting.FileSystemObject
      Dim fil As Scripting.File
      Set fil = fso.GetFile(“C:Text.xls”)
      Debug.Print fil.DateLastModified
      Set fil = Nothing
      Set fso = Nothing

    • #914461

      You can use code like this:

      Debug.Print CreateObject(“Scripting.FileSystemObject”).GetFile(“C:Test.xls”).DateLastModified

      This doesn’t require you to set a reference. If you want more control, set a reference (in Tools | References) to Microsoft Scripting Runtime, and use code like this:

      Dim fso As New Scripting.FileSystemObject
      Dim fil As Scripting.File
      Set fil = fso.GetFile(“C:Text.xls”)
      Debug.Print fil.DateLastModified
      Set fil = Nothing
      Set fso = Nothing

    Viewing 1 reply thread
    Reply To: File Data (v2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: