Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,612
- Office Version
- 365
- 2016
- Platform
- Windows
Considering ...
txt_model = "Skittles"
I am trying to create the folder "Skittles" in the specified path using the code below.
In my testing, "Skittles" does not exist, so the folder is created in the appropriate location.
Once this is done, I want file explorer to open up the newly created folder. But the code here only opens up file explorer to it's most highest level, not to the individual folder level.
txt_model = "Skittles"
I am trying to create the folder "Skittles" in the specified path using the code below.
VBA Code:
Sub open_folder(txt_model As String)
Dim modelini As String
Dim ffound As String
If Right(txt_model, 1) = "." Then txt_model = Left(txt_model, (Len(txt_model) - 1))
modelini = Left(txt_model, 1)
fldpath = "M:\IFM\" & modelini & "\" & txt_model & "\"
ffound = Dir(fldpath)
If ffound = "" Then 'folder not found. Opt to create one.
MkDir fldpath
End If
Shell "explorer.exe /root," & fdlpath, vbNormalFocus
End Sub
In my testing, "Skittles" does not exist, so the folder is created in the appropriate location.
Once this is done, I want file explorer to open up the newly created folder. But the code here only opens up file explorer to it's most highest level, not to the individual folder level.