Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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("Creation Date")
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default 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
...
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("Creation Date")
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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("Creation Date")
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show file creation date in a worksheet cell Big Sean Excel Worksheet Functions 3 January 13th 09 07:27 PM
How can I get date of file creation to XLS cell in date format? Radek Simek Excel Worksheet Functions 3 November 8th 07 04:24 PM
Date Creation in Cell Dayne Dillon Excel Worksheet Functions 2 June 20th 06 12:03 PM
Day before creation date in cell or as sheet name No Name Excel Programming 9 May 8th 06 06:09 AM
How do I show file creation date in a cell in Excel? Eddie Armstrong Excel Worksheet Functions 7 December 14th 05 09:21 PM


All times are GMT +1. The time now is 09:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"