Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Exception
System.Exception
System.Exception

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

Remarks

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.

Example
Code Block
csharp
csharp
titleC#
           ExcelApplication xla = new ExcelApplication();
           Workbook WB= xla.Create(FileFormat.Xlsx);
           Worksheet worksheet= WB[0];          
           worksheet.SavePdf("Path/filename.pdf");            
Code Block
vb.net
vb.net
titlevb.net
	   Dim oExcelApp As New ExcelApplication()           
       Dim WB As Workbook = oExcelApp.Create(FileFormat.Xlsx) 
       Dim worksheet As Worksheet= WB[0]       
       worksheet.SavePdf("Path/filename.pdf"))