Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to obtain the path to a workbook when I open it and save it to
a named range "PathToForecastFile" in that workbook. I have the code to obtain the filename of the current workbook: =MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]", CELL("filename",A1))-FIND("[",CELL("filename",A1))-1) I need to send out templates to clients and I cannot guarrantee they will or can put it in a predefined path. Thanks, Dennis |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1)
-- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "ssGuru" wrote in message oups.com... I need to obtain the path to a workbook when I open it and save it to a named range "PathToForecastFile" in that workbook. I have the code to obtain the filename of the current workbook: =MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]", CELL("filename",A1))-FIND("[",CELL("filename",A1))-1) I need to send out templates to clients and I cannot guarrantee they will or can put it in a predefined path. Thanks, Dennis |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() =LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1) That gives me a #NAME? error Bob Thanks, Dennis |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Bob,
My mistrake... I temporarily had the R1C1 set and that caused the #Name error with the A1. However =LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1) results in a value of "C:\Data\SAP\[MT-ForecastRpt v2.070814.xls" and I ONLY want the path and NOT the file name. This also results in a path with an extra "[" bracket. Close to what I neeed but looking just for the path to the file. Thanks, Dennis |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK. This works
=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-1) Bracket needed to be reversed Thanks Bob for getting me started in the right direction. Dennis |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I thought you wanted the book name as well.
Glad you are sorted. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "ssGuru" wrote in message ups.com... OK. This works =LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-1) Bracket needed to be reversed Thanks Bob for getting me started in the right direction. Dennis |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to see full path name of open workbook? | Excel Discussion (Misc queries) | |||
Open Workbook using URL instead of network path | Excel Programming | |||
Get path of open workbook | Excel Programming | |||
how to open workbook without hardcoding path | Excel Programming | |||
Obtain full path to a directory | Excel Programming |