I am feeling dejay vu...
For those that don't know, below is the WindowToPDF() routine.
So, it could be:
WindowToPDF Application.GetSaveAsFilename
Of course you can add more bells and whistles. e.g. Make sure that the file extension they enter is pdf in a call to GetSaveAsFileName before WindowToPDF().
'Similar to jaslake,https://www.excelforum.com/excel-programming-vba-macros/1202015-print-userform-to-pdf-and-then-attach-it-to-an-email.html'and
'Similar to, https://www.ozgrid.com/forum/forum/help-forums/excel-general/100863-sending-userform-as-pdf
#If VBA7 Then
Declare PtrSafe Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As LongPtr)
#Else
Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
#End If
Private Const VK_SNAPSHOT = 44
Private Const VK_LMENU = 164
Private Const KEYEVENTF_KEYUP = 2
Private Const KEYEVENTF_EXTENDEDKEY = 1
Function WindowToPDF(pdf$, Optional Orientation As Integer = xlLandscape, _
Optional FitToPagesWide As Integer = 1) As Boolean
Dim calc As Integer, ws As Worksheet
With Application
.ScreenUpdating = False
.EnableEvents = False
calc = .Calculation
.Calculation = xlCalculationManual
End With
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
DoEvents
Set ws = Workbooks.Add(xlWBATWorksheet).Worksheets(1)
With ws
.PasteSpecial Format:="Bitmap", Link:=False, DisplayAsIcon:=False
.Range("A1").Select
.PageSetup.Orientation = Orientation
.PageSetup.FitToPagesWide = FitToPagesWide
.PageSetup.Zoom = False
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdf, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
.Parent.Close False
End With
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = calc
.CutCopyMode = False
End With
WindowToPDF = Dir(pdf) <> ""
End Function