An easier way than Peo's is to define a name containing a formula. This way
you don't have to parse the result to find the file name. Go to
Insert-Name-Define, and invent a name like "FileName" for example. In the
refers to box, enter "=get.document(1)" without the quotes, of course. Then
in the cell where you want the file name simply enter "=filename".
This will return the name of the file, followed by the sheet name. If you
want only the file name, change the 1 to an 88.
A potential drawback to this method is that if you try to copy a cell
using an XL4M command to another sheet, XL will crash.
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.