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
Bookmarks