To open a file or folder using VBA you can sue the follwing snippet.
This snippet should also work in VB6.

Sample VBA

Dim path As String
Dim explorerPath As String

explorerPath = Environ$("WINDIR") + "\Explorer.exe "
path = "C:\Users\Codesnippets\Desktop\test"
Call Shell(explorerPath + Chr(34) + path + Chr(34), vbNormalFocus)

One thought on “How to open a file or folder using VBA”

Leave a Reply