check the value of lFolderIndex... is it 37 when the error happens? If so, that's the problem... there may be 37 folders, but the colleciton goes from 0 to count-1... or 0 to 36...

See if this change works for you:
lFolderIndex = FSfolder.subfolders.count -1

-tg