I have code that works perfectly to get properties from folder files. However Code ask me to choose directory manually. Is there any option to change this code that allow me input this directory in the code and input predefined filetypes (currently code picks all folder files and list them, but for example notepad file has no video length that why i need to input filetypes in the code also). I will appreciate any help in this issue. Thank you.
Code that need modification:
Option ExplicitSub GetDetails() Dim oShell As Object Dim oFile As Object Dim oFldr As Object Dim lRow As Long Dim iCol As Integer Dim vArray As Variant vArray = Array(0, 27) '0=Name, 27=Lenght Set oShell = CreateObject("Shell.Application") lRow = 1 With Application.FileDialog(msoFileDialogFolderPicker) .Title = "Select the Folder..." If .Show Then Set oFldr = oShell.Namespace(.SelectedItems(1)) With oFldr For iCol = LBound(vArray) To UBound(vArray) Cells(lRow, iCol + 1) = .getdetailsof(.items, vArray(iCol)) Next iCol For Each oFile In .items lRow = lRow + 1 For iCol = LBound(vArray) To UBound(vArray) Cells(lRow, iCol + 1) = .getdetailsof(oFile, vArray(iCol)) Next iCol Next oFile End With End If End With End Sub