Anne Troy
asked on
Shell Code Needs a Tweak Excel 07 VBA Browse to folder
Sub OpenFolderRequest()
Dim sPath As String
sPath = "C:\HospImports"
retVal = Shell("explorer.exe " & sPath, vbNormalFocus)
End Sub
The code works great. Now, I want the spath to instead be a folder like:
\\mynetwork\folder & range(d4).value
I can get the \\mynetwork\folder to work great. It doesn't like the rest, which is just a folder name that resides in cell D4.
ASKER
The following just takes me to Documents, a/k/a C:\Users\atroy\Documents:
Sub OpenFolderRequest()
Dim sPath As String
sPath = "\\MyNetworkPath\myfolder\" & Range("d4").Value
retVal = Shell("explorer.exe " & sPath, vbNormalFocus)
End Sub
What else do you want it to do?
ASKER
I want it to take me to the folder in the sPath, which is a network folder.
ASKER
Anybody?
ASKER
I've requested that this question be deleted for the following reason:
No solution provided. The person who did respond didn't seem to pay attention to the fact that I needed a specific location.
No solution provided. The person who did respond didn't seem to pay attention to the fact that I needed a specific location.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great! Will try it Monday.
ASKER
Woohoo!
"\\mynetwork\folder" & range(d4).value
or
"\\mynetwork\folder\" & range(d4).value
depending whether D4 has a preceding \ or not