[]
Represents a worksheet.
public interface IWorksheet
Gets the active cell.
IRange ActiveCell { get; }
Returns the IPane object that represents the active pane of the worksheet.
IPane ActivePane { get; }
Returns an IAutoFilter object if filtering is on. Returns nothing if filtering is off (read-only).
IAutoFilter AutoFilter { get; }
Gets or sets whether the AutoFilter drop-down arrows are currently displayed on the sheet. This property is independent of the AutoFilterMode property (read or write).
bool AutoFilterMode { get; set; }
Gets or sets whether to generate columns automatically while binding data.
bool AutoGenerateColumns { get; set; }
Gets or sets the background graphic for a worksheet.
byte[] BackgroundPicture { get; set; }
Returns a IBackgroundPictures object that represents all the backgound pictures on the worksheet or chart sheet (read-only).
IBackgroundPictures BackgroundPictures { get; }
Returns the IRange object that represents all the cells on the worksheet (not just the cells that are currently in use). This object is read-only.
IRange Cells { get; }
Gets or sets the cell type for current sheet.
BaseCellType CellType { get; set; }
Gets or sets the column count of the worksheet when exported to JSON.
int ColumnCount { get; set; }
Returns the IRange object that represents all the columns on the specified worksheet (read-only).
IRange Columns { get; }
Returns the IComments collection that represents all the comments for the specified worksheet (read-only).
IComments Comments { get; }
Returns the ICommentsThreaded collection that represents all the threaded comments for the specified worksheet (read-only).
ICommentsThreaded CommentsThreaded { get; }
Gets the control collection of this worksheet.
IControlCollection Controls { get; }
Gets or sets the data source of data binding for current sheet.
object DataSource { get; set; }
Gets whether the worksheet is in filter mode (read-only).
bool FilterMode { get; }
Gets or sets whether the horizontal and vertical page breaks are fixed when inserting/deleting rows/columns.
bool FixedPageBreaks { get; set; }
Gets the frozen column.
int FreezeColumn { get; }
Gets the frozen row.
int FreezeRow { get; }
Gets the number of trailing frozen columns of the sheet.
int FreezeTrailingColumn { get; }
Gets the number of trailing frozen rows of the sheet.
int FreezeTrailingRow { get; }
Gets or sets the color of frozen line.
Color FrozenLineColor { get; set; }
Get the collection of horizontal page breaks within the print area.
IHPageBreaks HPageBreaks { get; }
Provides access to the collection of Hyperlinks contained in the worksheet.
IHyperlinks Hyperlinks { get; }
Gets or sets the index number of the object within the collection of similar objects.
int Index { get; set; }
Gets or sets the name of the object (read or write).
string Name { get; set; }
Returns the INames collection that represents all the worksheet-specific names (names defined with the "WorksheetName!" prefix). This is a read-only Names object.
INames Names { get; }
Returns an IOutline object that represents the outline for the specified worksheet (read-only).
IOutline Outline { get; }
Gets the outline column for the worksheet.
IOutlineColumn OutlineColumn { get; }
Returns a PageSetup object that contains all the page setup settings for the specified object.
IPageSetup PageSetup { get; }
Worksheet panes.
IPanes Panes { get; }
Returns an object that represents either a single PivotTable report (a IPivotTables object) or a collection of all the PivotTable reports (IPivotTables object) on a worksheet (read-only).
IPivotTables PivotTables { get; }
Gets or sets the protection status of the worksheet.
bool Protection { get; set; }
Returns the IProtectionSettings object that represents the protection options of the worksheet.
IProtectionSettings ProtectionSettings { get; }
Returns an instance of IRange which provides access to cell values, formulas, formatting and other cell properties and methods.
IRangeProvider Range { get; }
Gets or sets the row count of the worksheet when exported to JSON.
int RowCount { get; set; }
Returns the IRange object that represents all the rows on the specified worksheet. This is read-only Range object.
IRange Rows { get; }
Gets the selection range.
IRange Selection { get; }
Returns a IShapes object that represents all the shapes on the worksheet or chart sheet (read-only).
IShapes Shapes { get; }
Returns an object that represents the view settings of this worksheet(read-only).
IWorksheetView SheetView { get; }
Gets or sets whether to display the column outline. The default value is true, and this property only applies when interacting with SJS.
bool ShowColumnOutline { get; set; }
Gets or sets whether to display the row outline. The default value is true, and this property only applies when interacting with SJS.
bool ShowRowOutline { get; set; }
Returns the sorted values in the current worksheet (read-only).
ISort Sort { get; }
Gets the split column.
int SplitColumn { get; }
Gets the split row.
int SplitRow { get; }
Gets or sets the standard (default) height(in points) of all the rows in the worksheet (read-only).
double StandardHeight { get; set; }
Gets or sets the standard (default) height(in pixels) of all the rows in the worksheet (read-only).
double StandardHeightInPixel { get; set; }
Gets or sets the standard (default) width(in points) of all the columns in the worksheet (read or write).
double StandardWidth { get; set; }
Gets or sets the standard (default) width(in pixels) of all the columns in the worksheet (read or write).
double StandardWidthInPixel { get; set; }
Gets or sets the primary color of the tab.
Color TabColor { get; set; }
Returns a collection of ITable objects in the worksheet. This is a read-only ListObjects collection.
ITables Tables { get; }
Gets or sets the tag for current sheet.
object Tag { get; set; }
Gets the sheet's type.
SheetType Type { get; }
Returns the IRange object that represents the used range on the specified worksheet, its behavior is equivalent to GetUsedRange(UsedRangeType.Axis | UsedRangeType.Data | UsedRangeType.Comment | UsedRangeType.Style | UsedRangeType.Merge)
IRange UsedRange { get; }
Determines whether the object is visible (read or write Visibility).
Visibility Visible { get; set; }
Get the collection of vertical page breaks within the print area.
IVPageBreaks VPageBreaks { get; }
Returns the workbook.
IWorkbook Workbook { get; }
Makes the current sheet the active sheet. This is equivalent to clicking the sheet's tab.
void Activate()
Copies the sheet to the end of the specified workbook.
IWorksheet Copy(IWorkbook workbook = null)
workbook
IWorkbookSpecifies the workbook to which the sheet will be copied. If missing, the sheet will be copied to the current workbook.
The new copied sheet.
Copies the sheet to the location after the specified sheet.
IWorksheet CopyAfter(IWorksheet targetSheet)
targetSheet
IWorksheetThe sheet after which the copied sheet will be placed. It can be the sheet of the same or another workbook.
The new copied sheet.
Copies the sheet to the location before the specified sheet.
IWorksheet CopyBefore(IWorksheet targetSheet)
targetSheet
IWorksheetThe sheet before which the copied sheet will be placed. It can be the sheet of the same or another workbook.
The new copied sheet.
Deletes the object.
void Delete()
object Evaluate(string formula, IFormulaResolver resolver)
formula
stringresolver
IFormulaResolverConverts a Microsoft Excel name to an object or a value.
object Evaluate(string formula)
formula
stringRequired String. The name of the object, using the naming convention.
Freezes panes at the specified position.
void FreezePanes(int row, int column)
row
intThe frozen row position.
column
intThe frozen column position.
Freezes trailing panes at the specified position.
void FreezeTrailingPanes(int row, int column)
row
intThe trailing frozen row position.
column
intThe trailing frozen column position.
Generates a worksheet from the JSON stream.
void FromJson(Stream stream, DeserializationOptions deserializationOptions = null)
stream
System.IO.Streamthe input JSON stream.
deserializationOptions
DeserializationOptionsthe DeserializationOptions object.
Generates a worksheet from the JSON string.
void FromJson(string json, DeserializationOptions deserializationOptions = null)
json
stringthe input JSON string.
deserializationOptions
DeserializationOptionsthe DeserializationOptions object.
Gets the used range.
IRange GetUsedRange(UsedRangeType type = UsedRangeType.All)
type
UsedRangeTypeThe feature type.
Moves the sheet to the end of the specified workbook.
IWorksheet Move(IWorkbook workbook = null)
workbook
IWorkbookSpecifies the workbook to which the sheet will be moved. If missing, the sheet will be moved to the current workbook.
The moved sheet.
Moves the sheet to the location after the specified sheet.
IWorksheet MoveAfter(IWorksheet targetSheet)
targetSheet
IWorksheetThe sheet after which the moved sheet will be placed. It can be the sheet of the same or another workbook.
The moved sheet.
Moves the sheet to the location before the specified sheet.
IWorksheet MoveBefore(IWorksheet targetSheet)
targetSheet
IWorksheetThe sheet before which the moved sheet will be placed. It can be the sheet of the same or another workbook.
The moved sheet.
Prints the worksheet.
void PrintOut(PrintOutOptions options = null)
options
PrintOutOptionsOptions for printing the worksheet.
Protects a worksheet so that it cannot be modified.
void Protect(string password = null)
password
stringPassword to protect the worksheet.
Saves current worksheet to the specified format file stream.
void Save(Stream fileStream, SaveFileFormat fileFormat)
fileStream
System.IO.StreamThe specified file stream.
fileFormat
SaveFileFormatThe format of the file stream.
Saves current worksheet to the specified file stream.
void Save(Stream fileStream, SaveOptionsBase options)
fileStream
System.IO.StreamThe specified file stream.
options
SaveOptionsBaseThe options of saving the file stream.
Saves current worksheet to the specified format file.
void Save(string fileName, SaveFileFormat fileFormat)
fileName
stringThe specified file.
fileFormat
SaveFileFormatThe format of the file.
Saves current worksheet to the specified file.
void Save(string fileName, SaveOptionsBase options)
fileName
stringThe specified file.
options
SaveOptionsBaseThe options of saving the file.
Saves current worksheet to file.
void Save(string fileName)
fileName
stringThe specified file name.
Selects the object.
void Select(bool replace = true)
replace
boolTrue to replace the current selection with the specified object. False to extend the current selection to include any previously selected objects and the specified object.
Makes all rows of the currently filtered list visible. If AutoFilter is in use, this method changes the arrows to "All."
void ShowAllData()
Splits panes at the specified position.
void SplitPanes(int row, int column)
row
intThe split row position.
column
intThe split column position.
Saves the worksheet to the specified image stream using options.
void ToImage(Stream stream, ImageType imageType, ImageSaveOptions options)
stream
System.IO.StreamThe specified image stream.
imageType
ImageTypeSpecifies the type of image to create.
options
ImageSaveOptionsThe options for output image.
Saves the worksheet to the specified image stream.
void ToImage(Stream stream, ImageType imageType)
stream
System.IO.StreamThe specified image stream.
imageType
ImageTypeSpecifies the type of image to create.
Saves the worksheet to the specified image file using options.
void ToImage(string imageFile, ImageSaveOptions options)
imageFile
stringThe output image file.
options
ImageSaveOptionsThe options for output image.
Saves the worksheet to the specified image file.
void ToImage(string imageFile)
imageFile
stringThe output image file.
Generates a JSON string from the worksheet.
string ToJson(SerializationOptions serializationOptions = null)
serializationOptions
SerializationOptionsthe SerializationOptions object.
Generates a JSON stream from a worksheet.
void ToJson(Stream stream, SerializationOptions serializationOptions = null)
stream
System.IO.StreamThe specified JSON stream.
serializationOptions
SerializationOptionsthe SerializationOptions object.
Unfreezes panes.
void UnfreezePanes()
Unfreezes trailing panes.
void UnfreezeTrailingPanes()
Removes protection from the worksheet.
void Unprotect(string password = null)
password
stringPassword to protect the worksheet.
Unsplits panes.
void UnsplitPanes()
Occurs when the worksheet is activated.
event EventHandler Activated
Occurs before the worksheet is deleted.
event EventHandler BeforeDelete
Occurs when something changes in the cells.
event EventHandler<RangeEventArgs> Changed
Occurs when the worksheet is deactivated.
event EventHandler Deactivated
Occurs when the selection changes on a worksheet.
event EventHandler<RangeEventArgs> SelectionChange