Consulting

Results 1 to 6 of 6

Thread: When running a macro, Excel suddenly stops responding

  1. #1
    VBAX Contributor D_Marcel's Avatar
    Joined
    Feb 2012
    Location
    Tokyo
    Posts
    117
    Location

    When running a macro, Excel suddenly stops responding

    Hello Masters!

    Hope that everything is doing well with everybody.
    I got from internet a simple and functional code to update MP3 tags by loading the extension cddbcontrol.dll. The problem is that the Excel always stops responding after some time of execution. I separated all my files in lots of 800. I could update the first one successfully, but now even with smaller lots, Excel suddenly stops responding and restarts.

    Do you have an idea of what can cause this? This is the code:

    Sub Updater()
    Dim Register As Range
    Dim ID3 As New CddbID3Tag
    Set WorkArea = Plan1.Range(Cells(5, 1), Cells(Cells(Rows.Count, 1).End(xlUp).Row, 1))
    RowCounter = Cells(Rows.Count, 1).End(xlUp).Row - 4
    For Each Register In WorkArea
    Counter = Counter + 1
    Application.Wait Now + TimeValue("00:00:01")
    Application.StatusBar = "Updating tags from file " & Counter & " of " & _
    RowCounter & " | Progress : " & Format((Counter) / RowCounter, "Percent")
    ID3.LoadFromFile Register.Value, False
    ID3.Album = Register.Offset(0, 5).Value
    ID3.Title = Left(Register.Offset(0, 2).Value, (Len(Register.Offset(0, 2).Value) - 4))
    ID3.LeadArtist = Register.Offset(0, 4).Value
    ID3.TrackPosition = Register.Offset(0, 3).Value
    ID3.SaveToFile Register.Value
    Next Register
    End Sub
    Yesterday after several attempts, the method SaveToFile stopped working, even restarting the machine.

    Thanks in advance!

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    You might want to use GetDetailsOf() instead. http://www.mrexcel.com/forum/excel-q...es-solved.html

  3. #3
    VBAX Contributor D_Marcel's Avatar
    Joined
    Feb 2012
    Location
    Tokyo
    Posts
    117
    Location
    Thanks Kenneth!

    I'll try to use this one that you recommended.

  4. #4
    VBAX Contributor D_Marcel's Avatar
    Joined
    Feb 2012
    Location
    Tokyo
    Posts
    117
    Location
    Hello Masters,

    Just to keep as register. After some researchs, I opted for use the application 'Tag & Rename', because I would have to search the internet the same way to find the informations of the tracks. With this one, you can mass update all tracks of an album, what makes the job easier in my opinion.

    Kind regards

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    D_Marcel,

    Can you share your new code with us?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  6. #6
    VBAX Contributor D_Marcel's Avatar
    Joined
    Feb 2012
    Location
    Tokyo
    Posts
    117
    Location
    Hello Sam! Actually friend, I did not develop a new code, as I mentioned, I chose to use a software to update the tags of the MP3 files. If I use the VBA, I would have to obtain those information and put them in all rows corresponding to the tracks. With this software you only have to put the informations in the fields of a window that is displayed after match the album in the database of Amazon, Discogs or Tracktype:

    ScreenHunter_04 Jan. 14 19.02.jpg

    And update all tracks in the same time by pressing "Write Tags!" button.
    You can also organize the file names according to some variables, for example, Artist & " - " & Album.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •