Forum

Meta Data (like "Cr...
 
Notifications
Clear all

Meta Data (like "Creation Date") from one single Excel sheet

3 Posts
3 Users
0 Reactions
323 Views
(@bartkowiak)
Posts: 12
Eminent Member
Topic starter
 

Hi all,

I´m looking for a way to read the meta data form single files, like "Creation Date", or "Modify Date" to use it as information for the user on a separate column or wherever.

I read, that it is obviously possible, if I load the data from a folder, but I haven´t found anything yet that explains the way, how to get these information from a single file.

Do you know, how?

Thx

best regards, Christoph

 
Posted : 24/12/2021 7:16 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Christoph,

You can use the From Folder connector and then filter the list of files to only include the one you want to get the meta data from.

Mynda

 
Posted : 24/12/2021 7:32 am
Alan Sidman
(@alansidman)
Posts: 221
Member Moderator
 

Maybe this VBA will help you?

Sub ListAllFile()

Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim ws As Worksheet
Dim sPath As String
Dim lrA As Long
Dim lrB As Long

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set ws = Worksheets.Add

'Get the folder object associated with the directory
sPath = InputBox("What is the full Path to Search?")
Set objFolder = objFSO.GetFolder(sPath)
ws.Cells(1, 1).Value = "The files found in " & objFolder.Name & " are:"
ws.Cells(1, 2).Value = "The files found have modified dates:"
ws.Cells(1, 3).Value = "The file Size is:"

'Loop through the Files collection
For Each objFile In objFolder.Files
'If objFile.Name Like "*.txt" Then
lrA = Range("A" & Rows.Count).End(xlUp).Row
lrB = Range("B" & Rows.Count).End(xlUp).Row
ws.Range("A" & lrA + 1).Value = objFile.Name
ws.Range("B" & lrB + 1).Value = objFile.DateLastModified
ws.Range("C" & lrB + 1).Value = objFile.Size
'End If
Next
'ws.Cells(2, 1).Delete
'Clean up!
Set objFolder = Nothing
Set objFile = Nothing
Set objFSO = Nothing

End Sub

 
Posted : 24/12/2021 3:11 pm
Share: