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 stream specified, or reading from the Workbook object.

Remarks

The Worksheet.PageSetup property will be used to specify how each worksheet should be rendered to the PDF document.  The individual PageSetup options are reflected in the final document.  Each worksheet uses its own PageSetup property to determine how that worksheet should be rendered.

Example
Code Block
csharp
csharp
titleC#
           ExcelApplication xla = new ExcelApplication();
           Workbook WB= xla.Create(FileFormat.Xlsx);
           FileStream fstream = new FileStream(@"C:\temp\outfile.pdf", FileMode.Create);    
           WB.SavePdf(false, fstream);
Code Block
vb.net
vb.net
titlevb.net
	   Dim oExcelApp As New ExcelApplication()           
       Dim wb As Workbook = oExcelApp.Create(FileFormat.Xlsx)       
       Dim fstream As New FileStream("C:\temp\outfile.pdf", FileMode.Create)          
       wb.SavePdf(False, fstream)