A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Hi Michelle
If you have a defined file path and filename
I humbly suggest you not use/prompt the Save As dialog box, it is a waste of time.
You may try the following code
Sub SaveAsPDF2()
''' This macro coverts the whole sheet into .pdf file format
''' And will save it to a file path set by the User
Dim pdfName As String, pdfPath As String
pdfPath = "F:\Master\4 Supplier - Purchases\" ''This is where you set a default file path
With ActiveSheet
pdfName = .Range("J4").Value ''' This variable stores the pdf filename
If pdfName <> "" Then
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdfPath & pdffName & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
MsgBox "File Saved to" & " " & pdfPath & pdffName
Else
MsgBox "File Name is Blank, Please check again"
End If
End With
End Sub
I hope this helps you and gives a solution to your problem
Do let me know if you need more help
Regards
Jeovany