Document Properties

B

Barb R.

I would like to use the "WorkbookName" document property within an excel cell
(if that is the appropriate name). How do I get that name to be displayed
within a cell of my worksheet?

Thanks in advance,
Barb Reinhardt
 
A

arno

Hi Barb,
I would like to use the "WorkbookName" document property within an
excel cell (if that is the appropriate name). How do I get that
name to be displayed within a cell of my worksheet?

path:
=LEFT(CELL("filename",A1),SEARCH("\[",CELL("filename",A1))-1)&"\"

filename:
=MID(CELL("filename",A1),SEARCH("\[",CELL("filename",A1))+2,SEARCH("]",
CELL("filename",A1))-SEARCH("\[",CELL("filename",A1))-2)

I hope it is "filename", pls. see help on cell()-function.

arno
 
R

RagDyeR

This should help:

http://www.xldynamic.com/source/xld.xlFAQ0002.html
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

I would like to use the "WorkbookName" document property within an excel
cell
(if that is the appropriate name). How do I get that name to be displayed
within a cell of my worksheet?

Thanks in advance,
Barb Reinhardt
 
B

bj

look at the help on "Cell()"
=cell("Filename") will give you a filename including path. See if this will
give you want you want
 
B

Barb R.

Thanks. That got me to where I could get the info I needed out of the
filename. I actually have a file name with the end date of the work week in
the file name. I wanted to parse out the end date and fill it in within the
spreadsheet in the appropriate places so that I didn't have to manually edit
those cells.

arno said:
Hi Barb,
I would like to use the "WorkbookName" document property within an
excel cell (if that is the appropriate name). How do I get that
name to be displayed within a cell of my worksheet?

path:
=LEFT(CELL("filename",A1),SEARCH("\[",CELL("filename",A1))-1)&"\"

filename:
=MID(CELL("filename",A1),SEARCH("\[",CELL("filename",A1))+2,SEARCH("]",
CELL("filename",A1))-SEARCH("\[",CELL("filename",A1))-2)

I hope it is "filename", pls. see help on cell()-function.

arno
 
D

David McRitchie

I would suggest that you always include a cell reference if you want
a correct answer See comments in italic near the top of
http://www.mvps.org/dmcritchie/excel/pathname.htm
various usages are then supplied to extract workbookname, worksheetname, etc.

If you think it doesn't make any difference because it is all in the same
workbook. That is also an incorrect assumption. Type in your
crippled formula =cell("filename")
then open another workbook, and hit F9, then return to your first
workbook. It will have the values from the second workbook. So
you would want to start with
=cell("filename",A1)
it doesn't matter what cell on the sheet you refer to, all you need is
a reference within the sheet you want to refer to, or the workbook in this case.
 
Top