+ Reply to Thread
Results 1 to 3 of 3

Request Directory From User - VBA Code

  1. #1

    Request Directory From User - VBA Code

    I am trying to find the VBA code to prompt the user for the directory
    to save a file. The code will define the files name, I just need the
    user to direct the program to the folder which the user would like the
    file saved in. I have been searching all over the internet but cannot
    find the write answer. Please help.


  2. #2
    Bob Phillips
    Guest

    Re: Request Directory From User - VBA Code

    Since XL2002 there is a browse dialog.
    With Application.FileDialog(msoFileDialogFolderPicker)
    .Show


    MsgBox .SelectedItems(1)


    End With


    Look up FileDialog in the VBA help


    --

    HTH

    Bob Phillips

    (replace xxxx in the email address with gmail if mailing direct)

    <[email protected]> wrote in message
    news:[email protected]...
    > I am trying to find the VBA code to prompt the user for the directory
    > to save a file. The code will define the files name, I just need the
    > user to direct the program to the folder which the user would like the
    > file saved in. I have been searching all over the internet but cannot
    > find the write answer. Please help.
    >




  3. #3
    NickHK
    Guest

    Re: Request Directory From User - VBA Code

    If you need to support versions prior to XL2002, use the BrowseForFolder
    API.
    http://www.cpearson.com/excel/BrowseFolder.htm

    NickHK

    <[email protected]> wrote in message
    news:[email protected]...
    > I am trying to find the VBA code to prompt the user for the directory
    > to save a file. The code will define the files name, I just need the
    > user to direct the program to the folder which the user would like the
    > file saved in. I have been searching all over the internet but cannot
    > find the write answer. Please help.
    >




+ 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