This code is inside private sub
CommonExplorer, which is called by public subs
Explorer or
Explorer2. In both cases, the call to
CommonExplorer is the very last statement before
End Sub.
Unlike
DoEvents, which interrupts processing and allows UI updating,
Sleep() returns to the calling sub which, in this particular case, immediatly ends. Maybe this interrupts the code flow.
It's just a guess. I'm absolutely not sure, but even if I'm wrong, I do believe this is a good starting point and most certainly I'll learn a bit more about
Sleep, Wait For and resumable subs...