0

Is possible get current directory without using VBA? (to avoid using macros)

I know that is possible via VBA, but I am trying to avoid using macros in my document.

Community
  • 1
  • 1
unairoldan
  • 2,775
  • 4
  • 28
  • 49

3 Answers3

3

You can use INFO formula to get path of the current directory or folder. Just write it in any cell

 =INFO("directory")
Dmitry Pavliv
  • 35,333
  • 13
  • 79
  • 80
3
=LEFT(CELL("filename"),SEARCH("[",CELL("filename"))-1)

This will get local physical path. If file is on a remote machine, it will return the network path.

=INFO("DIRECTORY")

This will get network path (with machine name). NOTE: for me it just returns the networked My Directory folder from ANY file it is called from. Be careful.

ttaaoossuuuu
  • 7,786
  • 3
  • 28
  • 58
1

You can use the forumula

 =CELL("filename", A1) 

then substring it

UPDATE: the better solution is

 =INFO("DIRECTORY") 
owenrumney
  • 1,520
  • 3
  • 18
  • 37