![]() |
|
#1
|
|||
|
|||
|
Hello,
I need some help to get the content created date including the seconds on excel files. I use Windows 8.1 and Office 2013. Best Regards, Gerhard |
|
#2
|
|||
|
|||
|
Thanks got it properties, statistics.
|
|
#3
|
||||
|
||||
|
You could use a macro like the following from any Office application:
Code:
Sub GetFileStats()
Application.ScreenUpdating = False
Dim FSO As Object, oItem As Object, StrDtTm As String
Dim strPath As String, strFile As String, strFullName As String, strData As String
strPath = GetFolder
If strPath = "" Then Exit Sub
strPath = strPath & "\"
strData = "File Stats For" & vbTab & strPath
If FSO Is Nothing Then Set FSO = CreateObject("Scripting.FileSystemObject")
strFile = Dir(strPath & "*.xls", vbNormal)
While strFile <> ""
strFullName = strPath & strFile
Set oItem = FSO.GetFile(strFullName)
strData = strData & vbCrLf & vbCrLf & "Filename:" & vbTab & strFile & vbCrLf & _
"Date Created: " & vbTab & Format(oItem.DateCreated, "DD/MMM/YYYY @ hh:mm:ss") & vbCrLf & _
"Date Last Modified: " & vbTab & Format(oItem.DateLastModified, "DD/MMM/YYYY @ hh:mm:ss")
strFile = Dir()
Wend
Open strPath & "FileStats.txt" For Output As #1
Print #1, strData
Close #1
Application.ScreenUpdating = True
End Sub
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Excel found unreadable content in file.xls. Do you want to recover the content of this workbook?
|
Sanfran | Excel | 2 | 10-21-2014 12:09 AM |
| Excel pivot table with a DATE value field for some reason stops at a certain date | angie450 | Excel Programming | 2 | 08-19-2014 08:50 AM |
Multiple Userforms Displaying Different Content but Returning Same Content?
|
marksm33 | Word VBA | 1 | 02-24-2014 06:17 PM |
macro for change content of cell2 when content of cell1 changes
|
Intruder | Excel Programming | 1 | 11-17-2012 08:24 PM |
| Package for CD with links to Windows media player content and Flash Shockwave content | hectorh | PowerPoint | 4 | 10-15-2009 12:22 PM |