Originally Posted by
Hitori
you can Try adding the following:
Sub ExcelToPDF2()
Dim iPtr As Long
Dim sFileName As String
If iPtr = 0 Then
sFileName = ActiveWorkbook.FullName & ".pdf"
Else
sFileName = Left(ActiveWorkbook.FullName, iPtr - 1) & ".pdf"
End If
sFileName = Range("h8").Value + ".pdf"
If sFileName = "False" Then Exit Sub
Sheet1.ExportAsFixedFormat Type:=xlTypePDF, Filename:=sFileName, Quality:=xlQualityStandard, openAfterPublish:=True
End Sub
Thanks Hitori, I used the following code now and it worked
Bookmarks