Macro to apply MP3 tags changes with VBA

lolica12

New Member
Joined
Sep 30, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi! So I got my whole Music Library in a Folder (+5000 Songs) and I wanted to rearrange the tags of the mp3 files and the file name.

So I got to this code to Read the properties of every mp3 file in a folder:

"

Sub Read_MP3_Files()

Dim FolderPath As Variant
Dim Item As Object
Dim oFile As Object
Dim oFolder As Object
Dim oShell As Object
Dim r As Long
Dim Rng As Range

' Prompt the user to select a folder
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Select a Folder"
If .Show = -1 Then
FolderPath = .SelectedItems(1)
Else
Exit Sub
End If
End With

Range("A1:H1") = Array("File Name", "Song Title", "Artist", "Album", "Year", "Genre", "Description", "Art Cover")
Set Rng = Range("A2")

Set oShell = CreateObject("Shell.Application")

Set oFolder = oShell.Namespace(FolderPath)
If oFolder Is Nothing Then
MsgBox "Folder was Not Found", vbExclamation
Exit Sub
End If

Set oFile = oFolder.Items

oFile.Filter 64, "*.mp3"

If oFile.Count = 0 Then
MsgBox "No MP3 Files Were Found in this Folder.", vbExclamation
Exit Sub
End If

For Each Item In oFile
With oFolder
Rng.Offset(r, 0) = .GetDetailsOf(Item, 0)
Rng.Offset(r, 1) = .GetDetailsOf(Item, 21)
Rng.Offset(r, 2) = .GetDetailsOf(Item, 20)
Rng.Offset(r, 3) = .GetDetailsOf(Item, 14)
Rng.Offset(r, 4) = .GetDetailsOf(Item, 15)
Rng.Offset(r, 5) = .GetDetailsOf(Item, 16)
Rng.Offset(r, 6) = .GetDetailsOf(Item, 25)

End With
r = r + 1
Next Item

End Sub

"

But now, I need another macro to then apply the changes that I will make on excel to those files.

I attached a photo with an example of the outcome of the macro on some mp3 files that i had on a test folder.

( The file as a column named "Art Cover" that i intend to also give me the art cover of the mp3 files, but im going step by step first ) - Open for suggestions.

Thank you!
 

Attachments

  • MP3 Tags.png
    MP3 Tags.png
    89.1 KB · Views: 61

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
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: Macro to apply MP3 tags changes with VBA
There is no need to repeat the link(s) provided above but if you have posted the question at other 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
I am sorry, i am new in forums.
I also cross posted in Macro to apply MP3 tags changes with VBA

Just trying to find some help on how to avoid MP3tags and rearrange my mp3 folder with excel.
I also thought on connecting python to make the changes afterwards, but still no luck on doing so. Will try to keep you updated if i find any solution.

Thank you, and i appreciate any help that can come :)
 
Upvote 0
Hi - sorry - just saw this. Thank you for providing the cross-post link.

Reading MP3 metadata details is relatively easy, but setting this is a bit trickier. Have you had an opportunity to explore the different versions of ID3 tags (what you've referred to as MP3 tags)? I ask because the higher the version number, the more involved the code. If all you're after is ID3v1 tags (except for the artwork) then that's relatively straightforward. Would that work?
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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