+ Reply to Thread
Results 1 to 10 of 10

Selecting an output folder

  1. #1
    simonc
    Guest

    Selecting an output folder

    Is there an equivalent dialog to GetSaveAsFilename which will just select the
    folder to save a file in instead of returning a full filename? The intention
    is that my macro will process a list of files and for each input file will
    write an output file in the same user selected folder. A standard dialog
    would hopefully give the user the option to create a new folder for the
    outputs if it doesn't already exist.

    Grateful for advice.

  2. #2
    ben
    Guest

    RE: Selecting an output folder

    excel 2003 has a Folder Select Dialog Box

    --
    When you lose your mind, you free your life.
    Ever Notice how we use '' for comments in our posts even if they aren''t
    expected to go into the code?


    "simonc" wrote:

    > Is there an equivalent dialog to GetSaveAsFilename which will just select the
    > folder to save a file in instead of returning a full filename? The intention
    > is that my macro will process a list of files and for each input file will
    > write an output file in the same user selected folder. A standard dialog
    > would hopefully give the user the option to create a new folder for the
    > outputs if it doesn't already exist.
    >
    > Grateful for advice.


  3. #3
    Bob Phillips
    Guest

    Re: Selecting an output folder

    Isn't that what GetSaveAsFilename does? You can create extra folders from
    that dialog.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "simonc" <[email protected]> wrote in message
    news:[email protected]...
    > Is there an equivalent dialog to GetSaveAsFilename which will just select

    the
    > folder to save a file in instead of returning a full filename? The

    intention
    > is that my macro will process a list of files and for each input file will
    > write an output file in the same user selected folder. A standard dialog
    > would hopefully give the user the option to create a new folder for the
    > outputs if it doesn't already exist.
    >
    > Grateful for advice.




  4. #4
    ben
    Guest

    RE: Selecting an output folder

    look up in help for dialogboxes

    --
    When you lose your mind, you free your life.
    Ever Notice how we use '' for comments in our posts even if they aren''t
    expected to go into the code?


    "simonc" wrote:

    > Is there an equivalent dialog to GetSaveAsFilename which will just select the
    > folder to save a file in instead of returning a full filename? The intention
    > is that my macro will process a list of files and for each input file will
    > write an output file in the same user selected folder. A standard dialog
    > would hopefully give the user the option to create a new folder for the
    > outputs if it doesn't already exist.
    >
    > Grateful for advice.


  5. #5
    Ron de Bruin
    Guest

    Re: Selecting an output folder

    Hi Simon

    Try this

    You can use FolderName now in the save path of the file

    Sub test()
    'Browse to the folder
    Dim oApp As Object
    Dim oFolder
    Dim FolderName

    Set oApp = CreateObject("Shell.Application")
    Set oFolder = oApp.BrowseForFolder(0, "Select folder to Zip", 512)
    If Not oFolder Is Nothing Then
    FolderName = oFolder.Self.Path
    If Right(FolderName, 1) <> "\" Then
    FolderName = FolderName & "\"
    End If
    MsgBox FolderName
    End If
    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "simonc" <[email protected]> wrote in message news:[email protected]...
    > Is there an equivalent dialog to GetSaveAsFilename which will just select the
    > folder to save a file in instead of returning a full filename? The intention
    > is that my macro will process a list of files and for each input file will
    > write an output file in the same user selected folder. A standard dialog
    > would hopefully give the user the option to create a new folder for the
    > outputs if it doesn't already exist.
    >
    > Grateful for advice.




  6. #6
    simonc
    Guest

    RE: Selecting an output folder

    Thanks for amazingly quick reply. Unfortunately I have Excel 2000. Is there
    any equivalent for 2000?

    "ben" wrote:

    > excel 2003 has a Folder Select Dialog Box
    >
    > --
    > When you lose your mind, you free your life.
    > Ever Notice how we use '' for comments in our posts even if they aren''t
    > expected to go into the code?
    >
    >
    > "simonc" wrote:
    >
    > > Is there an equivalent dialog to GetSaveAsFilename which will just select the
    > > folder to save a file in instead of returning a full filename? The intention
    > > is that my macro will process a list of files and for each input file will
    > > write an output file in the same user selected folder. A standard dialog
    > > would hopefully give the user the option to create a new folder for the
    > > outputs if it doesn't already exist.
    > >
    > > Grateful for advice.


  7. #7
    simonc
    Guest

    Re: Selecting an output folder

    Thanks for this which works perfectly. How do you people know about all these
    options???!!! I found if I changed the third option from 512 to 0 it even
    gives me a New Folder option button, although I couldn't figure out from the
    MSDN page on BrowseForFolder how the different options relate to the integer
    value you put in here.

    Many thanks

    "Ron de Bruin" wrote:

    > Hi Simon
    >
    > Try this
    >
    > You can use FolderName now in the save path of the file
    >
    > Sub test()
    > 'Browse to the folder
    > Dim oApp As Object
    > Dim oFolder
    > Dim FolderName
    >
    > Set oApp = CreateObject("Shell.Application")
    > Set oFolder = oApp.BrowseForFolder(0, "Select folder to Zip", 512)
    > If Not oFolder Is Nothing Then
    > FolderName = oFolder.Self.Path
    > If Right(FolderName, 1) <> "\" Then
    > FolderName = FolderName & "\"
    > End If
    > MsgBox FolderName
    > End If
    > End Sub
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "simonc" <[email protected]> wrote in message news:[email protected]...
    > > Is there an equivalent dialog to GetSaveAsFilename which will just select the
    > > folder to save a file in instead of returning a full filename? The intention
    > > is that my macro will process a list of files and for each input file will
    > > write an output file in the same user selected folder. A standard dialog
    > > would hopefully give the user the option to create a new folder for the
    > > outputs if it doesn't already exist.
    > >
    > > Grateful for advice.

    >
    >
    >


  8. #8
    Ron de Bruin
    Guest

    Re: Selecting an output folder

    Hi Simon

    > I found if I changed the third option from 512 to 0 it even
    > gives me a New Folder option button, although I couldn't figure out from the
    > MSDN page on BrowseForFolder how the different options relate to the integer
    > value you put in here.


    I never search for the numbers because I never need more then the 512 that I
    believe Jim Rech posted a long time ago.

    If I have time I will search for more info about this


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "simonc" <[email protected]> wrote in message news:[email protected]...
    > Thanks for this which works perfectly. How do you people know about all these
    > options???!!! I found if I changed the third option from 512 to 0 it even
    > gives me a New Folder option button, although I couldn't figure out from the
    > MSDN page on BrowseForFolder how the different options relate to the integer
    > value you put in here.
    >
    > Many thanks
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi Simon
    >>
    >> Try this
    >>
    >> You can use FolderName now in the save path of the file
    >>
    >> Sub test()
    >> 'Browse to the folder
    >> Dim oApp As Object
    >> Dim oFolder
    >> Dim FolderName
    >>
    >> Set oApp = CreateObject("Shell.Application")
    >> Set oFolder = oApp.BrowseForFolder(0, "Select folder to Zip", 512)
    >> If Not oFolder Is Nothing Then
    >> FolderName = oFolder.Self.Path
    >> If Right(FolderName, 1) <> "\" Then
    >> FolderName = FolderName & "\"
    >> End If
    >> MsgBox FolderName
    >> End If
    >> End Sub
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "simonc" <[email protected]> wrote in message news:[email protected]...
    >> > Is there an equivalent dialog to GetSaveAsFilename which will just select the
    >> > folder to save a file in instead of returning a full filename? The intention
    >> > is that my macro will process a list of files and for each input file will
    >> > write an output file in the same user selected folder. A standard dialog
    >> > would hopefully give the user the option to create a new folder for the
    >> > outputs if it doesn't already exist.
    >> >
    >> > Grateful for advice.

    >>
    >>
    >>




  9. #9
    Jim Cone
    Guest

    Re: Selecting an output folder

    Hi Ron,

    Following is an excerpt from a post by _
    Joe Earnest - public.scripting.vbscript - 04/20/2005

    Jim Cone
    San Francisco, USA
    http://www.realezsites.com/bus/primitivesoftware

    '---------------------
    The following are the generally useful long integer bitwise code flags for dialog operation:

    &H0001 1 Only returns file system folders.
    Will not select a virtual folder.

    &H0002 2 Does not include network folders below the domain level.

    &H0010 16 Displays an edit box for user input specification.

    &H0020 32 Validates the user specification in the edit box, if implemented.
    This option does not appear to work as documented on all versions of
    Windows.

    &H0040 64 Displays a "new style" dialog box, at least for Win2k.
    This option will be ignored, if specified for WinXp,
    and may be ignored on versions of Windows other than Win2k.

    &H0100 256 Displays a user "hint" in a WinXp-style dialog, if the edit box
    is not implemented. Available only for WinXp.
    This option is ignored, if an edit box is implemented.

    &H0200 512 Suppresses display of the New Folder button in a WinXp-style
    dialog. Available only for WinXp.

    &H04000 16384 Displays files as well as folders, and allows file selection.
    The files will display properly in all versions. With Win2k, however, a
    runtime error is generated if a root directory file is selected, and with
    WinXp, a runtime error is generated if any file is selected.
    '-----------------------------



    "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    Hi Simon
    > I found if I changed the third option from 512 to 0 it even
    > gives me a New Folder option button, although I couldn't figure out from the
    > MSDN page on BrowseForFolder how the different options relate to the integer
    > value you put in here.

    I never search for the numbers because I never need more then the 512 that I
    believe Jim Rech posted a long time ago.
    If I have time I will search for more info about this
    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


  10. #10
    Ron de Bruin
    Guest

    Re: Selecting an output folder

    Thanks for posting this Jim

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Jim Cone" <[email protected]> wrote in message news:[email protected]...
    > Hi Ron,
    >
    > Following is an excerpt from a post by _
    > Joe Earnest - public.scripting.vbscript - 04/20/2005
    >
    > Jim Cone
    > San Francisco, USA
    > http://www.realezsites.com/bus/primitivesoftware
    >
    > '---------------------
    > The following are the generally useful long integer bitwise code flags for dialog operation:
    >
    > &H0001 1 Only returns file system folders.
    > Will not select a virtual folder.
    >
    > &H0002 2 Does not include network folders below the domain level.
    >
    > &H0010 16 Displays an edit box for user input specification.
    >
    > &H0020 32 Validates the user specification in the edit box, if implemented.
    > This option does not appear to work as documented on all versions of
    > Windows.
    >
    > &H0040 64 Displays a "new style" dialog box, at least for Win2k.
    > This option will be ignored, if specified for WinXp,
    > and may be ignored on versions of Windows other than Win2k.
    >
    > &H0100 256 Displays a user "hint" in a WinXp-style dialog, if the edit box
    > is not implemented. Available only for WinXp.
    > This option is ignored, if an edit box is implemented.
    >
    > &H0200 512 Suppresses display of the New Folder button in a WinXp-style
    > dialog. Available only for WinXp.
    >
    > &H04000 16384 Displays files as well as folders, and allows file selection.
    > The files will display properly in all versions. With Win2k, however, a
    > runtime error is generated if a root directory file is selected, and with
    > WinXp, a runtime error is generated if any file is selected.
    > '-----------------------------
    >
    >
    >
    > "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > Hi Simon
    >> I found if I changed the third option from 512 to 0 it even
    >> gives me a New Folder option button, although I couldn't figure out from the
    >> MSDN page on BrowseForFolder how the different options relate to the integer
    >> value you put in here.

    > I never search for the numbers because I never need more then the 512 that I
    > believe Jim Rech posted a long time ago.
    > If I have time I will search for more info about this
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >




+ 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