ExcelFile = ActiveWorkbook.FullName
PDFConv = CreateObject("NuancePDFConverterProfessional8.NuanceConverterProfessional")
'Set the path of the output PDF file
PDFFile = Replace(ExcelFile, ".xlsx", ".pdf")
'Convert the file to PDF
PDFConv.OpenInputFile ExcelFile
PDFConv.SetConvertToPDFFileName PDFFile
PDFConv.ConvertToPDF
PDFConv.CloseInputFile
Set PDFConv = Nothing