Results 1 to 4 of 4

Current Drive/Path

This is a discussion on Current Drive/Path within the Excel Questions forums, part of the Question Forums category; I execute .xls file by browsing to its drive/path and doubleclicking. I want my code to write files back to ...

  1. #1
    New Member
    Join Date
    Jan 2003
    Posts
    5

    Default

    I execute .xls file by browsing to its drive/path and doubleclicking. I want my code to write files back to the same location as my .xls file.
    The CurDir function will return the current path but how do I get the drive that my .xls is on.

    Thanks

  2. #2
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    25,873

    Default

    Activate your Excel file (if not already active), then use "Path". See below:


    Windows("myfilename.xls").Activate
    MyPath = ActiveWorkbook.Path

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Calgary Canada
    Posts
    222

    Default

    Hi,

    My_path = workbooks("File.xls").Path

    Regards,

  4. #4
    New Member
    Join Date
    Jan 2003
    Posts
    5

    Default

    Thanks Guys,

    That ul do nicely. Kracking response too.

    Droid

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com