Getting metadata from music files and displaying on spreadsheet

Crazyredhead

New Member
Joined
Mar 23, 2021
Messages
5
Office Version
  1. 2010
Platform
  1. Windows
Guys, I have the following piece of code, snaffled from here (thankyou to Domenic, by the way), which actually now does what I want it to, but "manually" - I have to enter the desired path, etc., in Range A1 on sheet1.

Great for one odd folder, BUT I've been tasked with creating a list, on one spreadsheet, with all this information but for every folder and subfolder in a given area (for example G:\Users\P\Music\Music).

There are some 70,000 files, spread across numerous (3258!) folders - one for each album - and there's no way I can change this as the data concerned has been copied to four different computers for a degree of resilience.

Purpose of the spreadsheet is to allow comparision of the music files held on each machine, to identify any missing tracks following a rebuild or reinstall of Windows (something that's had to be done on several occasions now to various machines).

I've found a routine to recursively loop through all the files and sub folders and list them in one sheet, but, of course, the additional metadata I need is not there - I can only get the file size.

Can anyone assist, please? It sounds like such a simple query, but I can't fathom it out for the life of me - clearly, I lack the necessary VBA skills and training to work this out (I have no "formal" training, I just dabble and, eventually, it works!)

My ideal is to have all this information on one sheet. Can anyone help? Many thanks in advance if you can!

code snippet:
VBA Code:
Sub GetMetaDataFromSoundFiles()

    Dim objShellApp As Object
    Dim objFolder As Object
    Dim varColumns As Variant
    Dim arrData() As Variant
    Dim wksResults As Worksheet
    Dim strPath As String
    Dim strFilename As String
    Dim fileCount As Long
    Dim i As Long
    Dim j As Long
  
    strPath = ThisWorkbook.Worksheets("Sheet1").Range("A1").Value
  
    Set objShellApp = CreateObject("Shell.Application")
  
    On Error Resume Next
    Set objFolder = objShellApp.Namespace(CStr(strPath))
    If objFolder Is Nothing Then
        MsgBox "Folder not found!", vbExclamation, "Folder?"
        Set objShellApp = Nothing
        Exit Sub
    End If
    On Error GoTo 0
  
    varColumns = Array(192, 191, 13, 21, 243, 16, 14, 27, 1)
  
    ReDim arrData(0 To UBound(varColumns), 0 To objFolder.Items.Count)
  
    For i = LBound(arrData, 1) To UBound(arrData, 1)
        arrData(i, 0) = objFolder.GetDetailsOf(objFolder.Items, varColumns(i))
    Next i
  
    fileCount = 0
 
Last edited by a moderator:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Metadata and music files, recursively. Please help a newbie!
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
My apologies. Complete and utter newbie to message boards, so this was an inadvertent mistake.

Given that the original poster of the code that I'm using was from this site, I thought it more prudent to ask my question here, instead of on the other forum.
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top