Page tree
Skip to end of metadata
Go to start of metadata

Description

ExcelApplication is the main class for pure code-based workbook generation (for information about template-based workbook generation, see ExcelTemplate). This class is an engine used to open, create, and write (save or stream to a browser) workbooks. A single instance of ExcelApplication can generate multiple workbooks.
C#
vb.net

Remarks

A generated workbook is represented by the Workbook class.

To create an instance of ExcelApplication:

In C#:

  • Import ExcelApplication to the C# page:

  • Create an ExcelApplication object:

In VB.NET:

  • Import ExcelApplication to the VB.NET page:

  • Create an ExcelApplication object:

Properties

Name

Description

LicenseKey

The property sets or returns the license key that enables ExcelWriter. The key is stored in the registry. It contains information about ExcelWriter, including product name, platform, and version.

Version

Returns the exact version of ExcelWriter. The format of the version string returned is:

Methods

Name

Description

Create(FileFormat)

Creates a new workbook containing 1 worksheet, in the specified file format. The sheet is blank when the workbook is created, and standard font, style, and format settings applied.

ExcelApplication()

Creates a new ExcelApplication object

Open(ExcelTemplate)

Opens a Workbook from an ExcelTemplate object.

Open(String)

Opens an existing Excel spreadsheet.

Open(String, String)

Opens an existing Excel spreadsheet.

Open(System.IO.Stream)

Opens an Excel workbook from a stream and returns a Workbook object.

Open(System.IO.Stream, String)

Opens an Excel workbook from a stream and returns a Workbook object.

Save(Workbook, String)

Saves a specified Workbook as a  OOXML format (Excel 2007 or later) .xlsx or  BIFF8 format (Excel 97 or later) .xls file.

Save(Workbook, System.IO.Stream)

Saves a specified Workbook as a BIFF8 format (Excel 97 or later).xls file.

Save(Workbook, System.Web.HttpResponse, String, Boolean)

Streams the specified workbook to the client. It should be the only method that uses the response object, as it automatically sets response headers, clears the body of the response, and flushes it to the client.

Save(Workbook, System.Web.HttpResponse, String, Boolean, String)

Streams the specified workbook to the client. It should be the only method that uses the response object, as it automatically sets response headers, clears the body of the response, and flushes it to the client.

SaveToStream(Workbook)

Saves a specified Workbook object to a System.IO.Stream object and returns it.

Nested Classes

Name

Description

FileFormat

When creating Excel files with Create, specifies which file format to use.

Extension Methods

Introduced in build 7.5

Overload

Description

Open(Microsoft.SharePoint.SPDocumentLibrary, String)

Opens an existing Excel spreadsheet from a SharePoint Document Library.

Open(Microsoft.SharePoint.SPListItem, String)

Opens an existing Excel spreadsheet that is attached to a SharePoint List Item.

Save(Workbook, Microsoft.SharePoint.SPDocumentLibrary, String, Boolean)

Saves a specified Workbook as a BIFF8 format (Excel 97 or later) .xls file.

Save(Workbook, Microsoft.SharePoint.SPListItem, String)

Saves a specified Workbook as a BIFF8 format (Excel 97 or later) .xls file.
  • No labels