+ Reply to Thread
Results 1 to 2 of 2

Saving macro output to a specific location

  1. #1
    Registered User
    Join Date
    06-14-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    1

    Saving macro output to a specific location

    The VBA code below works, but the output defaults to the documents folder on the C drive. I would like the output to go to the following location: S:\DASO\Servicing\Reporting\Website Processing\Servicers for 15th

    Any help would be much apprecated!

    Paul

    Sub PDFAMOT()
    '
    ' PDFAMOT Macro
    ' Create PDF Copies of servicers
    '
    Dim i As Long
    Dim TabName2 As String
    Dim SName As String

    Application.DisplayAlerts = False
    ThisWorkbook.Sheets("AMOT PDF").Select

    For i = 10 To 65536
    If Range("B" & i).Value <> "" And Range("C" & i).Value = "Y" Then

    Windows("WebSiteMacros.xlsm").Activate
    Sheets("AMOT PDF").Select
    TabName2 = (Range("B" & i))
    SName = (Range("E" & i))

    Workbooks.Open Filename:= _
    Range("B4")

    Sheets(Array("Deal Summary", TabName2, "Pool Stats")).Select
    Sheets(TabName2).Activate

    ChDir "S:\DASO\Servicing\Reporting\Website Processing\Servicers for 15th"
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    SName _
    , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
    :=False, OpenAfterPublish:=False

    Windows("WebSiteMacros.xlsm").Activate
    Sheets("AMOT PDF").Select

    Range("D" & i).Value = "Yes"

    End If
    Next i

    Workbooks.Open Filename:= _
    Range("B4")
    ActiveWorkbook.Close

    MsgBox ("AMOT pdfs have been created")

    Application.DisplayAlerts = True
    ActiveWorkbook.Save
    End Sub

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Saving macro output to a specific location

    Just include the path name in SNAME.

    Please observe forum rule and put your code in code tags. Thanks.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

+ 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] Macro to manually choose PDF file and save it to a specific location with specific name
    By tnuis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2014, 07:47 AM
  2. [SOLVED] Merging Workbooks and Saving As in a Specific Location
    By jablo1312 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2014, 03:53 PM
  3. [SOLVED] Saving file in a date specific location
    By mayurpatil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2013, 01:30 AM
  4. macro output location
    By Ribeye in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2006, 11:10 AM
  5. saving file name and location with excel macro
    By Alex Suardi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:20 PM
  6. saving file name and location with excel macro
    By Alex Suardi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:17 PM
  7. VBA for saving a file to a specific location
    By TimT in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-07-2005, 04:05 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