I'm trying to print a range from an worksheet to PDF. I'm using this code, but it takes minutes to run, and then it tells me the document didn't save. I've looked online and haven't seen anything that really guides me more than what I've been able to piece together from multiple posts I was able to find. What am I missing here?
VBA Code:
Sub PrintToPDF()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim m As Workbook
Dim mMS As Worksheet
Dim fPath, fName As String
Set m = ThisWorkbook
Set mMS = m.Sheets("MS1")
fPath = "\\crpcltnaf01n2\CRE Bankruptcy Loan\Statement Operations\BK Special Statement Application\Created Statements\"
fName = mMS.Range("K7").Value & ".pdf"
mMS.Range("A1:K264").ExportAsFixedFormat xlTypePDF, _
Filename:=fPath & fName, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub