VBA Excel get access path

Solved
aurelie76 Posted messages 88 Status Membre -  
 Anonymous user -
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 réponses

lermite222 Posted messages 9042 Status Contributeur 1 199
 
Good evening,
To know the path of the file
 dim Path as string Path = Application.Path 'or.. Range("A1").value = Application.Path

See you!
54
aurelie76 Posted messages 88 Status Membre 3
 
Thank you so much lermitte222, you are helping me a lot with this instruction, have a good day, kisses, aurelie.
0