AW: Dateiattribute auslesen
22.11.2020 16:51:12
Nepumuk
Hallo Rolf,
teste mal:
Option Explicit
Public Sub Dateieigenschaften()
Const FOLDER_PATH As String = "G:\Eigene Dateien\Eigene Bilder\Fotos\Neuer Ordner\" 'Ordner anpassen !!!
Dim objShell As Object, objFolder As Object
Dim lngIndex As Long, lngColumn As Long, lngRow As Long
Dim vntFileName As Variant
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(FOLDER_PATH)
Application.ScreenUpdating = False
Cells.Clear
lngColumn = 1
For lngIndex = 0 To 400
Cells(1, lngColumn + lngIndex) = objFolder.GetDetailsOf(Empty, lngIndex)
Next
Rows(1).Font.Bold = True
lngRow = 2
For Each vntFileName In objFolder.Items
For lngIndex = 0 To 400
Cells(lngRow, lngColumn + lngIndex) = objFolder.GetDetailsOf(vntFileName, lngIndex)
Next
lngRow = lngRow + 1
Next
Columns.AutoFit
Application.ScreenUpdating = True
Set objFolder = Nothing
Set objShell = Nothing
End Sub
Gruß
Nepumuk