Relative path

  • Thread starter Thread starter Guest
  • Start date Start date
Relative to what?

Maybe...

Dim myPath as string
dim myPathParent as string

mypath = "C:\my documents\excel\test"
mypathparent = mypath & "\.."

Watch out for that backslash. Include it only one location.
 
It isn't clear what you are trying to accomplish, but you can use "..\" to
get a parent folder. E.g.,

ChDir "C:\Test\Sub1\SubSub1"
Debug.Print Dir("..\..\Sub1\Test.txt", vbNormal)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

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

Back
Top