+ Reply to Thread
Results 1 to 4 of 4

Identifying the user's drive letter

  1. #1
    Ben
    Guest

    Identifying the user's drive letter

    In all my macros the file references assume that the file structure resides
    under the c drive. If I want to distribute these macros what technique do I
    need to use so that they can be used by other people who may be on a network
    and whose drive letter is unknown to me.
    Thank you in advance

  2. #2
    Bob Phillips
    Guest

    Re: Identifying the user's drive letter

    If they have several drives mapped, how would you know which is their file
    drive.

    I would add some code that prompts for the user to supply the letter, on
    workbook open. Save the value somewhere, a hidden worksheet say, and then
    you can check if a value is there, and not prompt again.

    Also, think about an option to let them change it.

    Either that, or assume nothing, and use GrtOpenFilename to let them pick the
    file to open.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Ben" <[email protected]> wrote in message
    news:[email protected]...
    > In all my macros the file references assume that the file structure

    resides
    > under the c drive. If I want to distribute these macros what technique do

    I
    > need to use so that they can be used by other people who may be on a

    network
    > and whose drive letter is unknown to me.
    > Thank you in advance




  3. #3
    Mike Fogleman
    Guest

    Re: Identifying the user's drive letter

    CurDir will tell you the directory they are in now. From that you can
    extract the drive letter.

    Mike F
    "Ben" <[email protected]> wrote in message
    news:[email protected]...
    > In all my macros the file references assume that the file structure
    > resides
    > under the c drive. If I want to distribute these macros what technique do
    > I
    > need to use so that they can be used by other people who may be on a
    > network
    > and whose drive letter is unknown to me.
    > Thank you in advance




  4. #4
    Tushar Mehta
    Guest

    Re: Identifying the user's drive letter

    You must know something about the folder structure.

    If you don't, just ask the user to locate the file.

    If you do, make some guesses. If they fail, ask the user.

    Possible guesses:
    check c:\,
    identify the drive in curdir
    check the drive of the file with the code -- an add-in, I hope
    check the drive of the open data file
    check the drive of the system folder -- environ("systemroot")

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <[email protected]>,
    [email protected] says...
    > In all my macros the file references assume that the file structure resides
    > under the c drive. If I want to distribute these macros what technique do I
    > need to use so that they can be used by other people who may be on a network
    > and whose drive letter is unknown to me.
    > Thank you in advance
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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