P
Paul Martin
Hi all
I am using John Walkenbach's code to find the file name only from a
full path string. My structure is as follows:
PARENT_DIR
|
SUB_DIRECTORY
|
ThisWorkbook
I wish to ascertain the parent directory name. I have working code
(below) but am wondering if there's a simpler way to achieve this:
Dim sInitPath As String
Dim sNewPath As String
Dim sParentDir as string
sInitPath = CurDir
sNewPath = ThisWorkbook.Path & "\..\"
ChDrive sNewPath
ChDir sNewPath
sParentDir = FileNameOnly(CurDir)
ChDrive sInitPath
ChDir sInitPath
Thanks in advance
Paul Martin
Melbourne, Australia
I am using John Walkenbach's code to find the file name only from a
full path string. My structure is as follows:
PARENT_DIR
|
SUB_DIRECTORY
|
ThisWorkbook
I wish to ascertain the parent directory name. I have working code
(below) but am wondering if there's a simpler way to achieve this:
Dim sInitPath As String
Dim sNewPath As String
Dim sParentDir as string
sInitPath = CurDir
sNewPath = ThisWorkbook.Path & "\..\"
ChDrive sNewPath
ChDir sNewPath
sParentDir = FileNameOnly(CurDir)
ChDrive sInitPath
ChDir sInitPath
Thanks in advance
Paul Martin
Melbourne, Australia