+ Reply to Thread
Results 1 to 4 of 4

capture browseforfolder in string

  1. #1
    Registered User
    Join Date
    07-27-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    12

    capture browseforfolder in string

    Hello,

    I am trying to build a macro that prompts a user to select a folder and then creates a workbook and saves it in that folder. The problem I am having is that this new workbook is always saved at My Documents instead of the selected folder. I have a function (copied it from the web) that from what I understand creates a daialog box to select the folder, and then a sub which stores that folder into a variable. Then yet, a third sub that runs the first sub and then copies some cells to the new workbook.

    here is the code:

    Function
    Please Login or Register  to view this content.
    Macro 1
    Please Login or Register  to view this content.
    Macro 2
    Please Login or Register  to view this content.
    Thanks so much

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: capture browseforfolder in string

    In Generar(), replace:
    Please Login or Register  to view this content.
    with:
    Please Login or Register  to view this content.
    Now you don't need the FolderSelection() subroutine.

    Also, there are 2 compilation errors in the SelectFolder function - put Option Explicit at the top of the module, compile and fix the errors.
    Post responsibly. Search for excelforum.com

  3. #3
    Registered User
    Join Date
    07-27-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: capture browseforfolder in string

    @Chippy

    thank you. the macro is still saving the new workbook in my documents folder when i'm choosing a furhter path like
    my documets\dir\new folder\

    ---------- Post added at 10:20 AM ---------- Previous post was at 10:12 AM ----------

    never mind,

    i was mistyping a variable name in there somewhere. im an idiot

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: capture browseforfolder in string

    @ edjohns

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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