Pulling in the path to a filename

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there anyway to pull either the complete path or alternatively, the parent
folder of the xls file. For example, example.xls is located in the
c:\november directory,
I'd like to pull in either C:\november or just november.

Thanks
Pradhan
 
Set myPath = Activeworkbook.Path

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Use =CELL("filename") and parse out the part of the string that you need.
 
It's probably better in this case to include a cell from that worksheet:

=cell("filename",a1)
(any old cell will do)


If you open two workbooks and put:
=cell("Filename")
in A1 of a worksheet in each workbook
then use window|arrange|tiled
to see both worksheets,
you'll see the difference.
 
Thank you, although I must confess, I see no difference between the 2
functions with and without the included reference but I suspect that is due
to my requesting "filename" information.

Pradhan
 
Did you try that test?

If you did, then you should have seen that both cells showed the workbook name
that was active when the recalculation occurred.

If you didn't see it, you may want to do it again.
 

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