*iPath variable needs for path with music files for scanning.
Sub CreateReport_Mp3FileProperties()Dim iFileName$, iPath$, iRow&, iColumn&Dim iFolder As Object, iMp3File As ObjectiPath = "C:\Users\Office\Desktop\myfolder\": iRow = 2Set iFolder = CreateObject("Shell.Application").Namespace(CVar(iPath))If Not iFolder Is Nothing TheniFileName = Dir(iPath & "*.mp3")If iFileName <> "" ThenWorkbooks.Add xlWBATWorksheetApplication.ScreenUpdating = FalseDoApplication.StatusBar = iFileNameSet iMp3File = iFolder.ParseName(iFileName)For iColumn = 0 To 50 'Cells(iRow, iColumn + 1) = iFolder.GetDetailsOf(iMp3File, iColumn)NextiFileName = DiriRow = iRow + 1Loop While iFileName <> ""For iColumn = 0 To 50 ' Headers ReportCells(1, iColumn + 1) = iFolder.GetDetailsOf(iFolder.Items, iColumn)NextApplication.StatusBar = FalseApplication.ScreenUpdating = TrueElseMsgBox "No files .mp3", , ""End IfElseMsgBox "Folder doesn't exist", , ""End IfEnd Sub
Комментариев нет:
Отправить комментарий