Hi,
I have the code below that saves a wksht range as a PDF.
I would like the PDF to save to a specific folder that is found in cell S17 in the wkhst, so for example S17 contains the following text string resulting from a formula: C:\Users\Steve\Desktop\Data Files
Any help much appreciated, thanks.
I have the code below that saves a wksht range as a PDF.
I would like the PDF to save to a specific folder that is found in cell S17 in the wkhst, so for example S17 contains the following text string resulting from a formula: C:\Users\Steve\Desktop\Data Files
Any help much appreciated, thanks.
Code:
Dim Opendialog As String
Opendialog = Application.GetSaveAsFilename(Replace(Sheet88.[S16].Value, " /", ","), "PDF (*.pdf), *.pdf")
Opendialog = Replace(Opendialog, "/", ",")
If Opendialog = "False" Then Exit Sub
If Dir(Opendialog) <> "" Then
Err = MsgBox("File already exists. Do you want to overwrite existing file ?", vbQuestion + vbYesNo, "File already exists")
If Err = vbNo Then Exit Sub
End If
ActiveSheet.Range("B3:L149").ExportAsFixedFormat Type:=xlTypePDF, Filename:=Opendialog _
, Quality:=xlQualityHighest, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True