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,685
  • 4
  • 26
  • 47

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
  • 34,697
  • 12
  • 76
  • 78
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,626
  • 3
  • 27
  • 55
1

You can use the forumula

 =CELL("filename", A1) 

then substring it

UPDATE: the better solution is

 =INFO("DIRECTORY") 
owenrumney
  • 1,512
  • 2
  • 16
  • 36