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.

The Worksheet.PageSetup property will be used to specify how the worksheet should be rendered to the PDF document.  The individual PageSetup options are reflected in the final document.

           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"))