ComHelper Class
Contains methods that can be useful for users which are calling GemBox.Spreadsheet component using COM interop.
- Inheritance:
- System.
Object ComHelper
Constructors
ComHelper()
Initializes a new instance of the Com
Methods
AddPageBreak(Object, Int32, Boolean)
Adds a new horizontal or vertical page break above or left to the specified index.
Parameters
sheet
- System.
Object
The ExcelWorksheet instance in which to add a page break.
index
- System.
Int32
The zero-based index of the row or column.
horizontalBreak
- System.
Boolean
true for horizontal page break, false for vertical page break.
ComSetLicense(String)
Call this method from your application to set GemBox.Spreadsheet serial key.
Parameters
serialKey
- System.
String
Serial key.
Remarks
You should call this method before using any other class from GemBox.Spreadsheet library. Key can only be set once (if you try second key, exception will be thrown). The best place to call this method is from static constructor of your application's main class.
Valid serial key has multiple groups of alphanumeric characters, separated with dashes.
Free version serial key is: FREE-LIMITED-KEY.
GetColumn(Object, Int32)
Gets the column from a sheet with the specified index.
Parameters
sheet
- System.
Object
The ExcelWorksheet instance from which to retrieve the column.
index
- System.
Int32
The zero-based index of the column.
Returns
The ExcelColumn instance of the specified index.
GetRow(Object, Int32)
Gets the row from a sheet with the specified index.
Parameters
sheet
- System.
Object
The ExcelWorksheet instance from which to retrieve the row.
index
- System.
Int32
The zero-based index of the row.
Returns
The ExcelRow instance of the specified index.
IsEncrypted(String)
Determines whether the file is an encrypted XLSX.
Parameters
path
- System.
String
The path from which to read a file.
Returns
- System.
Boolean
true if file is an encrypted XLSX; otherwise, false.
Load(String)
Loads a spreadsheet from a file with the specified path.
Parameters
path
- System.
String
The path from which to load a spreadsheet.
Returns
A loaded spreadsheet.
Remarks
File extension that is extracted from the path
is used to create the appropriate Load
Following file extensions are supported:
- Microsoft Excel: .xlsx, xlsm, .xltx, .xltm, .xls, .xlt
- OpenDocument Spreadsheet: .ods, .ots
- Character Separated Values: .csv, .tsv
- HyperText Markup Language: .htm, .html, .mht, .mhtml
LoadWithOptions(String, Object)
Loads a spreadsheet from a file with the specified path.
Parameters
path
- System.
String
The path from which to load a spreadsheet.
options
- System.
Object
The loading options which can be used to define settings for load operation.
Returns
A loaded spreadsheet.
RemoveColumn(Object, Int32)
Removes the column with the specified index.
Parameters
sheet
- System.
Object
The ExcelWorksheet instance from which to remove the column.
index
- System.
Int32
The zero-based index of the column.
RemoveRow(Object, Int32)
Removes the row with the specified index.
Parameters
sheet
- System.
Object
The ExcelWorksheet instance from which to remove the row.
index
- System.
Int32
The zero-based index of the row.
SaveWithOptions(Object, String, Object)
Saves the spreadsheet to a file with the specified path.
Parameters
file
- System.
Object
The ExcelFile instance which to save.
path
- System.
String
The path to which to save the spreadsheet.
options
- System.
Object
The saving options which can be used to define settings for save operation.
SetFrozenWorksheetPanes(Object, String)
Sets frozen worksheet panes for freezing rows and columns.
Parameters
sheet
- System.
Object
The ExcelWorksheet instance in which to freeze row and column.
topLeftCell
- System.
String
Top left visible cell in the bottom right pane.