+ Reply to Thread
Results 1 to 5 of 5

Save As -- allow user to select saved location

  1. #1
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    Save As -- allow user to select saved location

    Hi excel forum -
    I'm not very good at VBA (disclaimer), so any suggestions are greatly appreciated.

    I currently have code that does the following:
    • Saves the print range as a PDF.
      Places customer's name (G8) in the saved file name.
      Places the current time in the saved file name.
      Places the date (G3) in the saved file name.
      Saves the file to a designated folder.

    My new goal:
    Keep everything I already have, but REMOVE the designated "saved to" folder ("Path" in my code below). Instead, let the user choose where they would like to save the PDF.

    Please Login or Register  to view this content.
    Thank you!

  2. #2
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: Save As -- allow user to select saved location

    Hi it's the original poster here. I thought maybe a re-post with a sample workbook could help.

    My VBA goal:
    1. Save the print area as a PDF.
    2. Allow the user to select the folder to which they would like to save the PDF.
    3. Include cell G3 in the saved PDF file name (date).
    4. Include cell G8 in the saved PDF file name (customer's name).
    5. Include the current time in the saved PDF file name.

    I'm definitely open to completely different VBA code (different from what I already have).

    Sample file is attached.
    Thank you!
    Jeff
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Save As -- allow user to select saved location

    hi

    Use this function and replace the path
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: Save As -- allow user to select saved location

    Thank you so much, Barieq! With a bit of playing around that solution worked beautifully!!

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi, try this ...


    According to post #2 attachment once the order logic corrected the button VBA procedure revamped :

    PHP Code: 
    Sub SaveAsPDF()
        
    Set V CreateObject("Shell.Application").BrowseForFolder(0vbLf "  Select destination folder :"1"")
         If 
    V Is Nothing Then Exit Sub Else V.Self.Path
         ExportAsFixedFormat 0
    "\Cal Pro QUOTE " & [G8] & Format([G3] + Time" yyyy-mm-dd hh" ChrW(5011) & "mm AM/PM "), 0
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need user to be able to select folder fiile will be saved into
    By ILoveStMartin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2021, 06:32 PM
  2. [SOLVED] VBA to enable user to select save location
    By Maleficent in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2019, 01:25 PM
  3. VBA to prompt user to select location to save file
    By Bevg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-13-2019, 01:33 PM
  4. [SOLVED] Macro to prompt user to select a file and the selected file should saved in location
    By logesh excel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-26-2015, 03:43 PM
  5. [SOLVED] [Help]macro to open file browser, to select a location, and save the location to a cell
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2013, 09:56 AM
  6. [SOLVED] Save PDF - Select file location
    By ZeDoctor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2013, 11:48 AM
  7. [SOLVED] VBA to open saved GIF of chart with dynamic save location
    By chiplaidlaw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2012, 04:50 AM

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