How to open a folder in Windows Explorer from VBA?

VBwhatnow picture VBwhatnow · Jun 26, 2012 · Viewed 188.3k times · Source

I want to click a button on my access form that opens a folder in Windows Explorer.

Is there any way to do this in VBA?

Answer

VBwhatnow picture VBwhatnow · Jun 26, 2012

You can use the following code to open a file location from vba.

Dim Foldername As String
Foldername = "\\server\Instructions\"

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

You can use this code for both windows shares and local drives.

VbNormalFocus can be swapper for VbMaximizedFocus if you want a maximized view.