Represents one worksheet in a Microsoft Excel workbook.

Inheritance

object

Inherited from: Sheet

Returns a boolean indicating if the Sheet has been protected with a password.

public bool HasProtectionPassword { get; }

Inherited from: Sheet

Returns a boolean indicating if the Worksheet has been protected.

public bool IsProtected { get; }

Inherited from: Sheet

Gets or sets the sheet name.

public string Name { get; set; }

Inherited from: Sheet

Gets the value which indicates whether this worksheet is selected.

public bool Selected { get; }

Inherited from: Sheet

Gets the zero-based index of this sheet in its parent collection.

public int SheetIndex { get; }

Inherited from: Sheet

Gets or sets the to use for the associated sheet's tab in the tab bar of Microsoft Excel.

public WorkbookColorInfo TabColorInfo { get; set; }

Inherited from: Sheet

Gets the that owns the worksheet.

public Workbook Workbook { get; }

Gets the collection of columns in the worksheet.

public WorksheetColumnCollection Columns { get; }

Returns a to which can be added to control the visual attributes of a based on user-defined criteria.

public ConditionalFormatCollection ConditionalFormats { get; }

Gets the collection of data tables in the worksheet.

public WorksheetDataTableCollection DataTables { get; }

Gets the collection of data validation rules applied to cells in the Worksheet.

public DataValidationRuleCollection DataValidationRules { get; }

Gets or sets the default column width including padding, in 256ths of the '0' digit character width in the workbook's default font.

public int DefaultColumnWidth { get; set; }

Gets or sets the default row height in twips (1/20th of a point).

public int DefaultRowHeight { get; set; }

Gets the object which controls the display of the worksheet.

public WorksheetDisplayOptions DisplayOptions { get; }

Exposes methods to identify a region in the worksheet and to apply filters and optionally sort criteria to that region.

public WorksheetFilterSettings FilterSettings { get; }

Gets the collection of hyperlinks applied to cells and regions in the Worksheet.

public WorksheetHyperlinkCollection Hyperlinks { get; }

Gets or sets the background image for the worksheet.

public ImageWrapper ImageBackground { get; set; }

Gets the zero-based index of this worksheet in its parent collection.

public int Index { get; }

Gets the collection of merged cell ranges in this worksheet.

public WorksheetMergedCellsRegionCollection MergedCellsRegions { get; }

Gets the object which controls how the worksheet prints.

public PrintOptions PrintOptions { get; }

Gets or sets the protection state of Excel worksheet.

[Obsolete("The Protected property has been deprecated. The IsProtected property will return the current protected state. The Protect and Unprotect methods are used to change the protection state.")]
public bool Protected { get; set; }

Returns an object that provides information used when the Worksheet has been protected.

public WorksheetProtection Protection { get; }

Gets the collection of rows in the worksheet.

public WorksheetRowCollection Rows { get; }

Gets the collection of shapes on the worksheet.

public WorksheetShapeCollection Shapes { get; }

Exposes methods to identify a region in the worksheet and to apply sort criteria to that region.

public WorksheetSortSettings SortSettings { get; }

Returns a collection of s (read-only)

public SparklineGroupCollection SparklineGroups { get; }

Gets the collection of instances, or regions formatted as tables, in the worksheet.

public WorksheetTableCollection Tables { get; }

Returns a value indicating the type of sheet

public override SheetType Type { get; }

Inherited from: Sheet

Attempts to use the specified password to remove the WorkSheet protection currently in place.

public void Unprotect(string password)

Parameters

  • password: string

Returns any

Inherited from: Sheet

Attempts to use the specified password to remove the Sheet protection currently in place.

public void Unprotect(SecureString password)

Parameters

  • password: SecureString

Returns any

Inherited from: Sheet

Moves the sheet to a new position in the owning workbook's collections of sheets.

public void MoveToSheetIndex(int index)

Parameters

  • index: int

Returns any

Inherited from: Sheet

Removes the Sheet protection.

public void Unprotect()

Returns any

Deletes a region of cells.

public void DeleteCells(WorksheetRegion region, bool shiftCellsLeft)

Parameters

  • region: WorksheetRegion
  • shiftCellsLeft: bool

Returns any

Deletes a region of cells.

public void DeleteCells(string address, bool shiftCellsLeft)

Parameters

  • address: string
  • shiftCellsLeft: bool

Returns any

Gets the cell at the specified address or name.

public WorksheetCell GetCell(string address)

Parameters

  • address: string

Returns any

Gets the cell at the specified address or name.

public WorksheetCell GetCell(string address, CellReferenceMode cellReferenceMode)

Parameters

  • address: string
  • cellReferenceMode: CellReferenceMode

Returns any

GetCell(string, CellReferenceMode, WorksheetCell)

Section titled "GetCell(string, CellReferenceMode, WorksheetCell)"

Gets the cell at the specified address or name.

public WorksheetCell GetCell(string address, CellReferenceMode cellReferenceMode, WorksheetCell originCell)

Parameters

  • address: string
  • cellReferenceMode: CellReferenceMode
  • originCell: WorksheetCell

Returns any

Gets the cell at the specified address or name.

public WorksheetCell GetCell(string address, WorksheetCell originCell)

Parameters

  • address: string
  • originCell: WorksheetCell

Returns any

Gets the cell conditional format for the cell at the specified row and column index.

public CellConditionalFormat GetCellConditionalFormat(int rowIndex, int columnIndex)

Parameters

  • rowIndex: int
  • columnIndex: int

Returns any

GetDefaultColumnWidth(WorksheetColumnWidthUnit)

Section titled "GetDefaultColumnWidth(WorksheetColumnWidthUnit)"

Gets the default column width in the specified units.

public double GetDefaultColumnWidth(WorksheetColumnWidthUnit units)

Parameters

  • units: WorksheetColumnWidthUnit

Returns any

Gets the region at the specified address or name.

public WorksheetRegion GetRegion(string address)

Parameters

  • address: string

Returns any

GetRegion(string, CellReferenceMode)

Section titled "GetRegion(string, CellReferenceMode)"

Gets the region at the specified address or name.

public WorksheetRegion GetRegion(string address, CellReferenceMode cellReferenceMode)

Parameters

  • address: string
  • cellReferenceMode: CellReferenceMode

Returns any

GetRegion(string, CellReferenceMode, WorksheetCell)

Section titled "GetRegion(string, CellReferenceMode, WorksheetCell)"

Gets the region at the specified address or name.

public WorksheetRegion GetRegion(string address, CellReferenceMode cellReferenceMode, WorksheetCell originCell)

Parameters

  • address: string
  • cellReferenceMode: CellReferenceMode
  • originCell: WorksheetCell

Returns any

Gets the region at the specified address or name.

public WorksheetRegion GetRegion(string address, WorksheetCell originCell)

Parameters

  • address: string
  • originCell: WorksheetCell

Returns any

Gets the regions at the specified address or name.

public WorksheetRegion[] GetRegions(string address)

Parameters

  • address: string

Returns any

GetRegions(string, CellReferenceMode)

Section titled "GetRegions(string, CellReferenceMode)"

Gets the regions at the specified address or name.

public WorksheetRegion[] GetRegions(string address, CellReferenceMode cellReferenceMode)

Parameters

  • address: string
  • cellReferenceMode: CellReferenceMode

Returns any

GetRegions(string, CellReferenceMode, WorksheetCell)

Section titled "GetRegions(string, CellReferenceMode, WorksheetCell)"

Gets the regions at the specified address or name.

public WorksheetRegion[] GetRegions(string address, CellReferenceMode cellReferenceMode, WorksheetCell originCell)

Parameters

  • address: string
  • cellReferenceMode: CellReferenceMode
  • originCell: WorksheetCell

Returns any

Gets the regions at the specified address or name.

public WorksheetRegion[] GetRegions(string address, WorksheetCell originCell)

Parameters

  • address: string
  • originCell: WorksheetCell

Returns any

Hides the columns in the specified range.

public void HideColumns(int? startIndex = null, int? count = null)

Parameters

  • startIndex: int?
  • count: int?

Returns any

Hides the rows in the specified range.

public void HideRows(int? startIndex = null, int? count = null)

Parameters

  • startIndex: int?
  • count: int?

Returns any

Inserts a region of cells.

public void InsertCells(WorksheetRegion region, bool shiftCellsRight)

Parameters

  • region: WorksheetRegion
  • shiftCellsRight: bool

Returns any

Inserts a region of cells.

public void InsertCells(string address, bool shiftCellsRight)

Parameters

  • address: string
  • shiftCellsRight: bool

Returns any

Moves the worksheet to a new position in the owning workbook's collections of worksheets.

public void MoveToIndex(int index)

Parameters

  • index: int

Returns any

Protect(bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?)

Section titled "Protect(bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?)"

Protects the worksheet without a password.

public void Protect(bool? allowDeletingColumns = null, bool? allowDeletingRows = null, bool? allowEditObjects = null, bool? allowEditScenarios = null, bool? allowFiltering = null, bool? allowFormattingCells = null, bool? allowFormattingColumns = null, bool? allowFormattingRows = null, bool? allowInsertingColumns = null, bool? allowInsertingHyperlinks = null, bool? allowInsertingRows = null, bool? allowSorting = null, bool? allowUsingPivotTables = null)

Parameters

  • allowDeletingColumns: bool?
  • allowDeletingRows: bool?
  • allowEditObjects: bool?
  • allowEditScenarios: bool?
  • allowFiltering: bool?
  • allowFormattingCells: bool?
  • allowFormattingColumns: bool?
  • allowFormattingRows: bool?
  • allowInsertingColumns: bool?
  • allowInsertingHyperlinks: bool?
  • allowInsertingRows: bool?
  • allowSorting: bool?
  • allowUsingPivotTables: bool?

Returns any

Protect(SecureString, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?)

Section titled "Protect(SecureString, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?)"

Protects the worksheet with the specified password.

public void Protect(SecureString password, bool? allowDeletingColumns = null, bool? allowDeletingRows = null, bool? allowEditObjects = null, bool? allowEditScenarios = null, bool? allowFiltering = null, bool? allowFormattingCells = null, bool? allowFormattingColumns = null, bool? allowFormattingRows = null, bool? allowInsertingColumns = null, bool? allowInsertingHyperlinks = null, bool? allowInsertingRows = null, bool? allowSorting = null, bool? allowUsingPivotTables = null)

Parameters

  • password: SecureString
  • allowDeletingColumns: bool?
  • allowDeletingRows: bool?
  • allowEditObjects: bool?
  • allowEditScenarios: bool?
  • allowFiltering: bool?
  • allowFormattingCells: bool?
  • allowFormattingColumns: bool?
  • allowFormattingRows: bool?
  • allowInsertingColumns: bool?
  • allowInsertingHyperlinks: bool?
  • allowInsertingRows: bool?
  • allowSorting: bool?
  • allowUsingPivotTables: bool?

Returns any

Protect(string, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?)

Section titled "Protect(string, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?)"

Protects the worksheet with the specified password.

public void Protect(string password, bool? allowDeletingColumns = null, bool? allowDeletingRows = null, bool? allowEditObjects = null, bool? allowEditScenarios = null, bool? allowFiltering = null, bool? allowFormattingCells = null, bool? allowFormattingColumns = null, bool? allowFormattingRows = null, bool? allowInsertingColumns = null, bool? allowInsertingHyperlinks = null, bool? allowInsertingRows = null, bool? allowSorting = null, bool? allowUsingPivotTables = null)

Parameters

  • password: string
  • allowDeletingColumns: bool?
  • allowDeletingRows: bool?
  • allowEditObjects: bool?
  • allowEditScenarios: bool?
  • allowFiltering: bool?
  • allowFormattingCells: bool?
  • allowFormattingColumns: bool?
  • allowFormattingRows: bool?
  • allowInsertingColumns: bool?
  • allowInsertingHyperlinks: bool?
  • allowInsertingRows: bool?
  • allowSorting: bool?
  • allowUsingPivotTables: bool?

Returns any

SetDefaultColumnWidth(double, WorksheetColumnWidthUnit)

Section titled "SetDefaultColumnWidth(double, WorksheetColumnWidthUnit)"

Sets the default column width in the specified units.

public void SetDefaultColumnWidth(double value, WorksheetColumnWidthUnit units)

Parameters

  • value: double
  • units: WorksheetColumnWidthUnit

Returns any

Unhides the columns in the specified range.

public void UnhideColumns(int? startIndex = null, int? count = null)

Parameters

  • startIndex: int?
  • count: int?

Returns any

Unhides the rows in the specified range.

public void UnhideRows(int? startIndex = null, int? count = null)

Parameters

  • startIndex: int?
  • count: int?

Returns any