troubleshooting Question

VBA Coding to open Windows Explorer with a particular location without opening multiple instances of that.

Avatar of stephenlecomptejr
stephenlecomptejrFlag for United States of America asked on
49 Comments3 Solutions122 ViewsLast Modified:
This code is great cause I can tell it to open Windows Explorer to a particular location.
The problem with it is it just keeps opening Windows Explorer every time it is ran.

What I want it to do is have it check to see if there is a Windows Explorer already opened with that location and if there is, put the Windows highlight on that particular one.

How may I change the below to do this?

Public Sub OpenWindowsExplorer(sFullFolderPath As String)
On Error GoTo Err_Proc

  Shell "C:\WINDOWS\explorer.exe """ & sFullFolderPath & "", vbNormalFocus

  Exit Sub
  Call LogError_feo(Err, Err.Description, "modCommon @ OpenWindowsExplorer")
  Resume Exit_Proc
End Sub
Mark Edwards
Chief Technology Officer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 49 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 49 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros