Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Getting timestamp from a file in Excel

Hi,

I'm looking for a macro/function that will allow me to get the
timestamps properties (date created) for a file in Excel and paste this
into a particular cell.

I imagined the set up would be something like:

Cell A1 - File location
Cell B1 - File name
Cell C1 - =Today()
Cell D1 - Some formula/macro/function that says "If the datestamp of
A1&B1 is the same as C1 then put a tick"

Can anyone help?

Many Thanks
Patrick
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default Getting timestamp from a file in Excel

You can get the creation date in VBA via:

activeworkbook.BuiltinDocumentProperties("creation date")

"Patrick" wrote:

Hi,

I'm looking for a macro/function that will allow me to get the
timestamps properties (date created) for a file in Excel and paste this
into a particular cell.

I imagined the set up would be something like:

Cell A1 - File location
Cell B1 - File name
Cell C1 - =Today()
Cell D1 - Some formula/macro/function that says "If the datestamp of
A1&B1 is the same as C1 then put a tick"

Can anyone help?

Many Thanks
Patrick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Getting timestamp from a file in Excel


I am not all that familiar with VBA. Could anyone give me a step by ste
to getting this to work. I tried on my own first but was unsucessful.

Thanks

--
jesterh
-----------------------------------------------------------------------
jesterhs's Profile: http://www.excelforum.com/member.php...fo&userid=2090
View this thread: http://www.excelforum.com/showthread.php?threadid=38745

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Getting timestamp from a file in Excel

This should get you started:

Look in VBA help under BuiltinDocumentProperties for more details. You
might like to change what sh and wb are in order that you don't write
over existing data and you report the details of the correct file.

HTH,
Gareth

Sub GetFileDetails()

Dim wb As Workbook
Dim sh As Worksheet

Set sh = ActiveSheet
Set wb = ActiveWorkbook

With sh
.Cells(1, 1).Value = "File name:"
.Cells(1, 2).Value = wb.Name
.Cells(2, 1).Value = "Location:"
.Cells(2, 2).Value = wb.Path
.Cells(3, 1).Value = "Created:"
.Cells(3, 2).Value = Format( _
wb.BuiltinDocumentProperties("creation date"), _
"dd mmm yyyy")
.Cells(4, 1).Value = "Created Today?"
.Cells(4, 2).Value = Date = DateSerial( _
Year(wb.BuiltinDocumentProperties("creation date")), _
Month(wb.BuiltinDocumentProperties("creation date")), _
Day(wb.BuiltinDocumentProperties("creation date")))

End With

Set wb = Nothing
Set sh = Nothing

End Sub


jesterhs wrote:
I am not all that familiar with VBA. Could anyone give me a step by step
to getting this to work. I tried on my own first but was unsucessful.

Thanks.


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
Displaying File Timestamp of Another Excel File [email protected] Links and Linking in Excel 3 July 23rd 08 06:06 PM
Displaying File Timestamp of Another Excel File [email protected] Charts and Charting in Excel 0 July 22nd 08 10:48 PM
Excel Sheet Timestamp DRK Excel Worksheet Functions 7 October 16th 06 06:54 PM
Getting timestamp from a file in Excel Patrick Excel Worksheet Functions 1 July 15th 05 12:55 PM
Timestamp function that does not update in Excel? Guard823 Excel Worksheet Functions 1 February 25th 05 01:10 PM


All times are GMT +1. The time now is 10:07 AM.

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"