+ Reply to Thread
Results 1 to 6 of 6

Acessing Starting Folder Path

  1. #1
    Forum Contributor
    Join Date
    10-02-2008
    Location
    Berkeley, CA
    MS-Off Ver
    Windows 2007
    Posts
    105

    Acessing Starting Folder Path

    I start an Excel program from a shortcut in different folders. I know that I can find the path of the Excel program in "Parent.Path". But I don't know how to find the path of the folder the shortcut was in. It should be findable because when I try to do something like <Save>, Excel knows the correct folder there.

    An example: I open Excel in "Folder 1" using a shortcut to the Excel Program in "Folder 2". Parent.Path tells me "Folder 2". How do I find out what "Folder 1" is from inside Excel?

    Thanks,

    Mac in Berkeley, CA

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello CaptMac,

    Welocme to the Forum!

    If I understand you correctly, you referring to a workbook and not the Excel application. The following code will return the full directory path for the workbook.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    10-02-2008
    Location
    Berkeley, CA
    MS-Off Ver
    Windows 2007
    Posts
    105

    Response to "Accessing Starting Folder Path"

    Thanks, Leith, for the response.

    With regards to my original example

    ThisWorkbook.Path yields the path to the folder the workbook is in: ie. /../Folder2.

    What I'm looking for is something that yields the path to the folder the shortcut was in: ie. /../Folder 1.

    Mac

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Does this work

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Contributor
    Join Date
    10-02-2008
    Location
    Berkeley, CA
    MS-Off Ver
    Windows 2007
    Posts
    105
    Thanks, RoyUK, for the reply. But...

    CurDir() gives me a pointer to my home directory, not to /../ Folder1
    when I tried it in my code.

    Mac

  6. #6
    Forum Contributor
    Join Date
    10-02-2008
    Location
    Berkeley, CA
    MS-Off Ver
    Windows 2007
    Posts
    105

    Solved

    It turns out that what I thought might work does NOT.

    The only reference to external files is the WorkBook.Parent. SO that's all one can find out.

    Captn Mac

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Is there a way of gettting the path of a filename in any folder
    By all4excel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-28-2021, 09:53 PM
  2. Copy and Paste Folder With VBA
    By cjconnor24 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-22-2014, 05:44 AM
  3. Trying to move all xls files from one folder to another
    By oakman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2008, 10:39 AM
  4. Cell is equal to a folder name up 3 levels of the path
    By crumpet in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-26-2007, 12:28 AM
  5. Folder Path.
    By gajendra.gupta in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2007, 04:11 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1