Please try this one
(whoops!! I never modified the rest of the function. Hang on a bit)
Ok, try it now.
(My theory is your system does not have Shell.Application object that's used to get the Explorer path associated with the window. If I'm right, the app still won't work, but it shouldn't crash. Please let me know what results you get with this version.)