+ Reply to Thread
Results 1 to 5 of 5

Save File Using a named range as the File Path

  1. #1
    Registered User
    Join Date
    11-15-2007
    Posts
    57

    Save File Using a named range as the File Path

    I am setting up a file for a couple of clients to use and I need the file path to save the files in to be specified by each individual client.

    I have set up a named range for this of 'Filepath'

    I have already managed to specify the filename in a similar way (range name 'Filename') and this works OK but it saves to the directory that the excel spreadsheet is saved to.

    The macro I use for this is:

    Sub pdfsave()

    pdfname = Range("Filename").Value

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdfname, Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
    End Sub
    I have attached a copy of the file.
    Attached Files Attached Files

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Save File Using a named range as the File Path

    Try with complete path..

    Please Login or Register  to view this content.
    Last edited by Debraj Roy; 09-18-2015 at 06:18 AM. Reason: EDITED..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Registered User
    Join Date
    11-15-2007
    Posts
    57

    Re: Save File Using a named range as the File Path

    Thanks for the reply but I think you may have misunderstood what I need.

    The filepath that the spreadsheet is saved in will not necessarily be the one that we need. The one that we need will be typed into a specific cell in the spreadsheet that has been given the range name "filepath" (cell B1 of the 'Path for filesaving' tab in the file attached to the original post.

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Save File Using a named range as the File Path

    OOPS.. my fault.. I overlooked, that you have a name range for path tooo...
    Please re-read.. above post.. (edited)

  5. #5
    Registered User
    Join Date
    11-15-2007
    Posts
    57

    Re: Save File Using a named range as the File Path

    Brilliant, that is spot on.

    Thank you

+ 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. [SOLVED] Save file as macro-enabled with path and file name from a cell
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2015, 11:51 PM
  2. VBA to save worksheet with a prefined file path and file name
    By KRUDA79 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2014, 08:27 AM
  3. Save a file: Only need the path, don't want user to put in file name
    By skania in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2013, 12:06 PM
  4. Macro to save sheet as CSV using a dynamic file name and file path
    By chris.tinta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2013, 10:45 AM
  5. file name and path save to another file
    By sm2irfan in forum Excel General
    Replies: 0
    Last Post: 01-31-2013, 08:45 AM
  6. Replies: 0
    Last Post: 01-27-2013, 12:13 PM
  7. [Ask] Import Text file And Call reference path file with Value Range.
    By dha_indra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2012, 11:09 PM

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