How to ascertain path of file in adjacent directory hierarchy

P

Paul Martin

Hi all

I am wondering what is the best method of ascertaining the path of a
file in an adjacent directory. Using the map below, I wish to
ascertain the path of "Another Workbook" relative to "ThisWorkbook".

PARENT_DIR
_________|________
| |
DIR_1 DIR_2
| |
ThisWorkbook Another Workbook


Any suggestions apppreciated

Paul Martin
Melbourne, Australia
 
P

Paul Martin

Just to clarify

I want to load a ListBox with the filenames in a given directory. In DOS,
the command to ascertain the directory would be:

dir ..\DIR_2

Thanks in advance

Paul Martin
Melbourne, Australia
 
P

Paul Martin

For anyone interested, I have found a solution as follows:

Dim sPath as String

sPath = ThisWorkbook.Path & "\..\DIR_2"

Paul Martin
Melbourne, Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top