Click or drag to resize
ExcelFile Class
Excel file contains one or more worksheets (ExcelWorksheet) and workbook related properties and methods.
Inheritance Hierarchy
SystemObject
  GemBox.SpreadsheetExcelFile

Namespace: GemBox.Spreadsheet
Assembly: GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 39.3.30.1189
Syntax
public sealed class ExcelFile

The ExcelFile type exposes the following members.

Constructors
  NameDescription
Public methodExcelFile
Initializes an empty (no worksheets) instance of the ExcelFile class.
Top
Methods
  NameDescription
Public methodStatic memberAutoDetectCsvSeparator(Stream)
Autodetects CSV separator. If there's no separators in the input stream returns (char)0.
Public methodStatic memberAutoDetectCsvSeparator(StreamReader, Int32, Char)
Autodetects CSV separator. If there's no separators in the input stream returns (char)0.
Public methodConvertToImageSource
Converts single page specified in options of this ExcelFile instance to an ImageSource instance.
Public methodConvertToXpsDocument
Converts this ExcelFile instance to an XpsDocument instance.
Public methodStatic memberCode exampleLoad(String)
Loads a spreadsheet from a file with the specified path.
Public methodStatic memberCode exampleLoad(Stream, LoadOptions)
Loads a spreadsheet from the specified stream.
Public methodStatic memberLoad(TextReader, CsvLoadOptions)
Loads a spreadsheet from CSV data using the specified reader.
Public methodStatic memberCode exampleLoad(String, LoadOptions)
Loads a spreadsheet from a file with the specified path.
Public methodStatic memberLoadFromDirectory(String, OdsLoadOptions)
Loads all parts of ODS file as separate files from input directory.
Public methodStatic memberLoadFromDirectory(String, XlsxLoadOptions)
Loads all parts of XLSX file as separate files from input directory.
Public methodCode examplePrint
Prints the document to the default printer.
Public methodCode examplePrint(String)
Prints the document to the specified printer.
Public methodCode examplePrint(String, PrintOptions)
Prints the document to the specified printer according to specified options.
Public methodCode exampleSave(String)
Saves the spreadsheet to a file with the specified path.
Public methodCode exampleSave(Stream, SaveOptions)
Saves the spreadsheet to the specified stream.
Public methodSave(TextWriter, CsvSaveOptions)
Save the spreadsheet to CSV format using the specified writer.
Public methodCode exampleSave(Object, String)
Saves the spreadsheet to a System.Web.HttpResponse or System.Web.HttpResponseBase output stream or a System.Net.Http.HttpResponseMessage and sets appropriate HTTP response headers (Content-Type and Content-Disposition). Use this method in ASP.NET application to send the spreadsheet to a client browser. File format is resolved from fileName extension. See remarks why httpResponse parameter is of type Object.
Public methodCode exampleSave(String, SaveOptions)
Saves the spreadsheet to a file with the specified path.
Public methodSave(XmlWriter, HtmlSaveOptions)
Save the spreadsheet to HTML format using the specified writer.
Public methodCode exampleSave(Object, String, SaveOptions)
Saves the spreadsheet to a System.Web.HttpResponse or System.Web.HttpResponseBase output stream or a System.Net.Http.HttpResponseMessage and sets appropriate HTTP response headers (Content-Type and Content-Disposition). Use this method in ASP.NET application to send the spreadsheet to a client browser. File format is defined with options parameter. See remarks why httpResponse parameter is of type Object.
Public methodSaveToDirectory(String, OdsSaveOptions)
Saves all parts of ODS file as separate files to output directory.
Public methodSaveToDirectory(String, XlsxSaveOptions)
Saves all parts of XLSX file as separate files to output directory.
Public methodStatic memberSupportsType
Gets a value indicating whether the objects of specified type can be assigned to ExcelCell.Value property.
Top
Properties
  NameDescription
Public propertyDefinedNames
Gets the collection of defined names that are not directly related with one cell range. Supported in XLSX only.
Public propertyDelayFormulaParse
Delays formula parsing until one of SaveXls methods is called.
Public propertyDocumentProperties
Gets DocumentProperties of this ExcelFile.
Public propertyGroupMethodsAffectedCellsLimit
Maximum number of affected cells in group set methods.
Public propertyCode examplePivotCaches

Gets the collection of PivotCaches defined in this ExcelFile instance.

Currently supported in XLSX only.

Public propertyProtected
Gets or sets the workbook protection flag.
Public propertyCode exampleStyles
Gets the collection of workbook (master) Styles defined for this ExcelFile instance.
Public propertyUse1904DateSystem
Gets or sets whether 1904 date system is used.
Public propertyWorksheets
Collection of all worksheets (ExcelWorksheet) in a workbook.
Top
See Also