Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to view the path of current excel sheet? Sivagami Excel Discussion (Misc queries) 2 August 6th 08 10:26 AM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
Accessing current project path Dhonan Excel Discussion (Misc queries) 0 August 15th 06 10:03 PM
Set The Directory to the Current WB Path Richy Excel Programming 2 February 29th 04 06:54 PM
How to get file's current directory path to a string in VBA? [email protected] Excel Programming 1 October 16th 03 07:41 AM


All times are GMT +1. The time now is 06:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"