Saves a Worksheet as a PDF file at a specified file path.

 public static void SavePdf(String filePath)
Public Static Sub SavePdf(ByVal filePath As String)

A string representing the filepath you would like to save the PDF to.

 

If there is a problem creating, opening, or writing to the file specified, or reading from the Worksheet object.

           ExcelApplication xla = new ExcelApplication();
           Workbook WB= xla.Create(FileFormat.Xlsx);
           Worksheet worksheet= WB[0];          
           worksheet.SavePdf("Path/filename.pdf");            
	   Dim oExcelApp As New ExcelApplication()           
       Dim WB As Workbook = oExcelApp.Create(FileFormat.Xlsx) 
       Dim worksheet As Worksheet= WB[0]       
       worksheet.SavePdf("Path/filename.pdf"))