Sub Update_File_List()
'==========================================================================================================
'- MACRO TO CHANGE EXTENDED FILE PROPERTIES OF .MP3 AND .WMA FILES IN WINDOWS EXPLORER
'- Reads from amended worksheet prepared with separate "Build_File_List" macro module.
'==========================================================================================================
'- .WMA files do not have track number column 4
'- this version uses CDDBControlRoxio.dll version 2.4.1.9 and Excel 2007 running on Windows 7 64 bit
'- (was unable to get CDDBControl.dll version 2.6.101.101 to work)
'- Suggest you copy some files to a special folder for testing first.
'- Steve Duckworth September 2011 based on a routine by....
'- Brian Baulsom May 2008 - using Excel 2000/Windows XP
'==========================================================================================================
'==========================================================================================================
'- Method (works on all files in a single folder)
'- 1. Run macro "Build_File_List" (other module) TO GET FILE NAMES INTO CURRENTLY ACTIVE WORKSHEET
'- 2. Amend file details in the worksheet. (Columns with names in BOLD only!)
'- 3. Run macro "Update_File_List" below.
'- N.B. This workbook assumes it is in the same folder as the music files
'==========================================================================================================
Dim ws As Worksheet
Dim Row As Long
Dim FQFN$
Dim MyFileType As String ' mp3 wma etc.
Dim CurPath As String
Dim id3 As Object
'==========================================================================================================
'- MAIN ROUTINE
'- Run down visible rows and change data
'==========================================================================================================
' Application.Calculation = xlCalculationManual
CurPath = ActiveWorkbook.Path
' CurName = ActiveWorkbook.Name
Sheets("File List").Select
Set ws = ActiveSheet
Set id3 = CreateObject("CDDBControlRoxio.CddbID3Tag")
' Set id3 = CreateObject("CDDBControl.CddbID3Tag")
Row = 2
'-----------------------------------------------------------------------------------------------------
'- LOOP WORKSHEET FILES - VISIBLE ROWS ONLY
Do Until Cells(Row, 1).Value = ""
FQFN$ = CurPath & "\" & Cells(Row, 1)
MyFileType = UCase(Right(FQFN$, 3))
'- Write to file
With id3
.LoadFromFile FQFN$, False ' True = Read Only
.LeadArtist = Cells(Row, 14) 'Contributing Artists
.Album = Cells(Row, 15) 'Album
.Year = Cells(Row, 16) 'Track Year
.Genre = Cells(Row, 17) 'Genre
'''' .Composer = Cells(Row, 21) 'Composers aka Author
'''' .ArtistFullname = Cells(Row, 21) 'Composers aka Author
.Title = Cells(Row, 22) 'Track Title
.Comments = Cells(Row, 25) 'Comments (N.B. these are NOT loaded by the read macro
If MyFileType = "MP3" Then .TrackPosition = Cells(Row, 27) 'Track or #
.SaveToFile FQFN$
End With
Row = Row + 1
'---------------------------------------------------------------------------------------------
Loop
'-----------------------------------------------------------------------------------------------------
'- end of program
'' Application.Calculation = xlCalculationAutomatic
'' rsp = MsgBox("Done" & vbCr & "Changed " & FilesChanged & " of " & FilesToChange)
'' Application.StatusBar = False
End Sub