VBA Excel get access path

Solved
Hello,

how can I retrieve the path of a directory and store this path "c:\folder\...." in a cell of a sheet?
Otherwise, I thought about opening the workbook, saving it as, and thereby retrieving the path and then deleting the file, but that's a more cumbersome solution. If there's a syntax that can get the filename and allow me to insert it into a cell, that would be great. I can't find anything on the subject in the forum.

Thanks to everyone for your help.
aurélie.
Configuration: Windows XP Internet Explorer 7.0

12 answers

  • Votes
  • Date
  • Descending date
  1. Contributor
    Good evening,
    To know the path of the file
     dim Path as string Path = Application.Path 'or.. Range("A1").value = Application.Path

    See you!
    1. Thank you so much lermitte222, you are helping me a lot with this instruction, have a good day, kisses, aurelie.