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?
To open Windows File Explorer to a specific folder, create a shortcut to “%SYSTEMROOT%\explorer.exe /e,<folder>”, where “<folder>” is the folder of your choice.
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.
The easiest way is
Application.FollowHyperlink [path]
Which only takes one line!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With