Try
root=File.DirRootExternal
path1 = root & "/music"
Dim fileList As List
Dim n As Int
tunepath=path1
'Search for mp3's
fileList = File.ListFiles(path1)
temp=filelist.Size-1
For n = 0 To fileList.Size-1
file1 = fileList.Get(n)
If (file1.EndsWith (".mp3")) OR (file1.EndsWith (".MP3"))Then
progbar1.Visible=True
If counter<1001 Then 'was 1500
musiclibrary(counter,1)="/"& file1
lblmikedent.Text="Indexing Song - " &counter
LogMp3Tags(path1, musiclibrary(counter,1))
counter=counter+1
End If
End If
Next