+ Reply to Thread
Results 1 to 3 of 3

Creation date in cell

  1. #1
    Guest

    Creation date in cell

    Hi
    I posted yesterday and got a few ideas for this, but I've run into a
    problem.
    The file that I am working on is an imported .txt and the macro that I am
    using crashes with a Run-time error 5 - Invalid procedure call or argument.
    The line I'm trying to use is this:
    Range("A2").Value =
    ActiveWorkbook.BuiltinDocumentProperties("CreationDate")
    and I'm wondering if it's because the sheet is not technically a workbook.
    The macro imports a .txt file, deletes junk from it and formats some of the
    columns and I need to get the creation date of the txt file.
    Thanks.
    AndyB



  2. #2
    Ardus Petus
    Guest

    Re: Creation date in cell

    ActiveWorkbook.BuiltinDocumentProperties("Creation Date")

    There was a blank missing between Creation and Date

    HTH
    --
    AP

    <AndyB> a écrit dans le message de
    news:[email protected]...
    > Hi
    > I posted yesterday and got a few ideas for this, but I've run into a
    > problem.
    > The file that I am working on is an imported .txt and the macro that I am
    > using crashes with a Run-time error 5 - Invalid procedure call or

    argument.
    > The line I'm trying to use is this:
    > Range("A2").Value =
    > ActiveWorkbook.BuiltinDocumentProperties("CreationDate")
    > and I'm wondering if it's because the sheet is not technically a workbook.
    > The macro imports a .txt file, deletes junk from it and formats some of

    the
    > columns and I need to get the creation date of the txt file.
    > Thanks.
    > AndyB
    >
    >




  3. #3
    Gary''s Student
    Guest

    RE: Creation date in cell

    If you run:

    Sub garbit()
    Dim fs, f
    Dim st, s As String
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile("C:\third.txt")
    s = "Created: " & f.DateCreated
    MsgBox s
    st = Split(s, " ")
    MsgBox (st(1))
    Range("A2").Value = st(1)
    End Sub

    you should get and see the creation date of the external file.


    Change file file reference and you can get the creation date of any external
    file.
    --
    Gary's Student


    "AndyB" wrote:

    > Hi
    > I posted yesterday and got a few ideas for this, but I've run into a
    > problem.
    > The file that I am working on is an imported .txt and the macro that I am
    > using crashes with a Run-time error 5 - Invalid procedure call or argument.
    > The line I'm trying to use is this:
    > Range("A2").Value =
    > ActiveWorkbook.BuiltinDocumentProperties("CreationDate")
    > and I'm wondering if it's because the sheet is not technically a workbook.
    > The macro imports a .txt file, deletes junk from it and formats some of the
    > columns and I need to get the creation date of the txt file.
    > Thanks.
    > AndyB
    >
    >
    >


+ 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