Class ExcelUtils
ExcelUtils is a helper class that is used for easy usage of direct XlsIO API in performing repetitive tasks.[The usage of this class is not recommended, Please refer to the documentation for updated sample code.]
Inheritance
Inherited Members
Namespace: Syncfusion.XlsIO
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class ExcelUtils
Constructors
ExcelUtils()
Declaration
public ExcelUtils()
Properties
ThrowNotSavedOnDestroy
Determines if an exception is thrown when there are unsaved workbook objects. Default is True.
Declaration
public static bool ThrowNotSavedOnDestroy { get; set; }
Property Value
Type |
---|
System.Boolean |
Methods
Close()
Not required. Obsolete.
Declaration
public static void Close()
CloseWorkBook()
Closes the Workbook object.
Declaration
public static void CloseWorkBook()
CreateWorkbook(Int32)
Creates a new workbook. The new workbook becomes the active Workbook.
Declaration
public static IWorkbook CreateWorkbook(int numberOfSheets)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | numberOfSheets | Number of Worksheets in the workbook. |
Returns
Type | Description |
---|---|
IWorkbook | Added Workbook object. |
CreateWorkbook(String[])
Creates a new workbook and the worksheets are named using the names supplied. The new workbook becomes the active workbook.
Declaration
public static IWorkbook CreateWorkbook(string[] names)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | names | Names of the Worksheets in the Workbook. |
Returns
Type | Description |
---|---|
IWorkbook | Added Workbook object. |
CreateWorkBookUsingTemplate(Stream)
Creates a workbook using the template file stream.
Declaration
public static IWorkbook CreateWorkBookUsingTemplate(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Base stream to create. |
Returns
Type | Description |
---|---|
IWorkbook | Workbook created from template. |
CreateWorkBookUsingTemplate(String)
Creates a workbook using the template file.
Declaration
public static IWorkbook CreateWorkBookUsingTemplate(string templateLocation)
Parameters
Type | Name | Description |
---|---|---|
System.String | templateLocation |
Returns
Type | Description |
---|---|
IWorkbook | Workbook created from template. |
Finalize()
Dispose excelEngine member.
Declaration
protected void Finalize()
Open(Stream)
Opens a workbook in the form of a stream.
Declaration
public static IWorkbook Open(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream |
Returns
Type | Description |
---|---|
IWorkbook | Opened workbook object. |
Open(String)
Opens the workbook in the specified location.
Declaration
public static IWorkbook Open(string fileLocation)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileLocation |
Returns
Type | Description |
---|---|
IWorkbook | Opened workbook object. |
PasteWorkbook()
Copies workbook from the clipboard.
Declaration
public static IWorkbook PasteWorkbook()
Returns
Type | Description |
---|---|
IWorkbook | Pasted workbook object. |