Dear all,
I wrote a VBA macro (partly mine and partyl snippets from the Internet) that lists all files that are contained in all zip files the macro can find in the starting path:
This works. It runs through every Folder down to zipArchive which contains multiple zip files with multiple files (no further Folders) within those zip file. I started to let the macro write down some Information about those files such as Name, size,...
NOW the reason I am doing this is that I am interested in the creation date/last modification date of the files within each zip file. So I used
which returns an error saying that the object does not support the method or property…
Thinks like Name and size work somehow
Can someone help out on this?
I wrote a VBA macro (partly mine and partyl snippets from the Internet) that lists all files that are contained in all zip files the macro can find in the starting path:
VBA Code:
folder_path = "C:\Users\[MYNAME]\Desktop\prod".
This works. It runs through every Folder down to zipArchive which contains multiple zip files with multiple files (no further Folders) within those zip file. I started to let the macro write down some Information about those files such as Name, size,...
NOW the reason I am doing this is that I am interested in the creation date/last modification date of the files within each zip file. So I used
VBA Code:
Range("B" & i).Value = fileNameInZip.DateCreated
which returns an error saying that the object does not support the method or property…
Thinks like Name and size work somehow
Can someone help out on this?
VBA Code:
Private Sub Get_Information3()
folder_path = "C:\Users\[MYNMAME]\Desktop\prod"
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Tabelle1")
Dim oFSO As Object Dim oFolder As Object 'prod
Dim oSubFolderSupplier As Object 'Supplier Dim oSubFolderCountry As Object
Dim oSubFolderDatabase As Object
Dim oSubFolderZipArchive As Object
Dim oFileinZipArchive As Object
Dim last_row As Integer
Dim oApp As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(folder_path)
Set oApp = CreateObject("Shell.Application")
Dim i, r As Integer Dim fileNameInZip As Variant
Dim Fname As Variant Dim sh1 As Worksheet
Set sh = ThisWorkbook.Sheets("Tabelle1")
Dim Stringtest As Integer
Dim test1 As String
i = 2
For Each oSubFolderSupplier In oFolder.SubFolders
For Each oSubFolderCountry In oSubFolderSupplier.SubFolders
For Each oSubFolderDatabase In oSubFolderCountry.SubFolders
For Each oSubFolderZipArchive In oSubFolderDatabase.SubFolders
For Each oFileinZipArchive In oSubFolderZipArchive.Files
Fname = Dir(oFileinZipArchive)
Stringtest = InStrRev(oFileinZipArchive, "\")
test1 = Left(oFileinZipArchive, Stringtest)
If Right(Fname, 4) = ".zip" Then
For Each fileNameInZip In oApp.Namespace(test1 & Fname).Items
Range("A" & i).Value = fileNameInZip.Name
Range("B" & i).Value = fileNameInZip.DateCreated
i = i + 1
Next
End If
Next
Next
Next
Next
Next
End Sub