Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
path to current file...
All,
I'm trying to retrieve the path to the current directory from which an Excel Template was opened. An interesting thing is that if you use the 'New' (right-click menu item) on an .XLT file, the 'ThisWorkbook.Path' is empty -- but, if you save the file as an .XLS and then open that .XLS -- 'ThisWorkbook.Path' has a value. What I need is a way of determining the path to the directory that the XLT resides in -- before I've saved the document as an .XLS. Any tips/help will be greatly appreciated. Thanks, -D --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
path to current file...
Hi daschund,
I'm trying to retrieve the path to the current directory from which an Excel Template was opened. An interesting thing is that if you use the 'New' (right-click menu item) on an .XLT file, the 'ThisWorkbook.Path' is empty -- but, if you save the file as an .XLS and then open that .XLS -- 'ThisWorkbook.Path' has a value. What I need is a way of determining the path to the directory that the XLT resides in -- before I've saved the document as an .XLS. Any tips/help will be greatly appreciated. I don't think this is possible. When you open a new workbook based on a template, you really are getting a new, unsaved workbook. So that workbook does not have a Path until you save it. If the user opens the template via Excel, you could check the CurDir$ function, which should return the correct path. But if the file was opened outside of Excel, I think you're out of luck. -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to view the path of current excel sheet? | Excel Discussion (Misc queries) | |||
Formula too long - new file path is shorter than old file path - Excel 2003 | Excel Worksheet Functions | |||
Accessing current project path | Excel Discussion (Misc queries) | |||
Set The Directory to the Current WB Path | Excel Programming | |||
How to get file's current directory path to a string in VBA? | Excel Programming |