Represents one worksheet in a Microsoft Excel workbook.
Properties
Section titled "Properties"HasProtectionPassword
Section titled "HasProtectionPassword"Inherited from: Sheet
Returns a boolean indicating if the Sheet has been protected with a password.
public bool HasProtectionPassword { get; } IsProtected
Section titled "IsProtected"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; } Selected
Section titled "Selected"Inherited from: Sheet
Gets the value which indicates whether this worksheet is selected.
public bool Selected { get; } SheetIndex
Section titled "SheetIndex"Inherited from: Sheet
Gets the zero-based index of this sheet in its parent collection.
public int SheetIndex { get; } TabColorInfo
Section titled "TabColorInfo"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; } Workbook
Section titled "Workbook"Inherited from: Sheet
Gets the that owns the worksheet.
public Workbook Workbook { get; } Columns
Section titled "Columns"Gets the collection of columns in the worksheet.
public WorksheetColumnCollection Columns { get; } ConditionalFormats
Section titled "ConditionalFormats"Returns a to which can be added to control the visual attributes of a based on user-defined criteria.
public ConditionalFormatCollection ConditionalFormats { get; } DataTables
Section titled "DataTables"Gets the collection of data tables in the worksheet.
public WorksheetDataTableCollection DataTables { get; } DataValidationRules
Section titled "DataValidationRules"Gets the collection of data validation rules applied to cells in the Worksheet.
public DataValidationRuleCollection DataValidationRules { get; } DefaultColumnWidth
Section titled "DefaultColumnWidth"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; } DefaultRowHeight
Section titled "DefaultRowHeight"Gets or sets the default row height in twips (1/20th of a point).
public int DefaultRowHeight { get; set; } DisplayOptions
Section titled "DisplayOptions"Gets the object which controls the display of the worksheet.
public WorksheetDisplayOptions DisplayOptions { get; } FilterSettings
Section titled "FilterSettings"Exposes methods to identify a region in the worksheet and to apply filters and optionally sort criteria to that region.
public WorksheetFilterSettings FilterSettings { get; } Hyperlinks
Section titled "Hyperlinks"Gets the collection of hyperlinks applied to cells and regions in the Worksheet.
public WorksheetHyperlinkCollection Hyperlinks { get; } ImageBackground
Section titled "ImageBackground"Gets or sets the background image for the worksheet.
public ImageWrapper ImageBackground { get; set; } Index
Section titled "Index"Gets the zero-based index of this worksheet in its parent collection.
public int Index { get; } MergedCellsRegions
Section titled "MergedCellsRegions"Gets the collection of merged cell ranges in this worksheet.
public WorksheetMergedCellsRegionCollection MergedCellsRegions { get; } PrintOptions
Section titled "PrintOptions"Gets the object which controls how the worksheet prints.
public PrintOptions PrintOptions { get; } Protected
Section titled "Protected"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; } Protection
Section titled "Protection"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; } Shapes
Section titled "Shapes"Gets the collection of shapes on the worksheet.
public WorksheetShapeCollection Shapes { get; } SortSettings
Section titled "SortSettings"Exposes methods to identify a region in the worksheet and to apply sort criteria to that region.
public WorksheetSortSettings SortSettings { get; } SparklineGroups
Section titled "SparklineGroups"Returns a collection of s (read-only)
public SparklineGroupCollection SparklineGroups { get; } Tables
Section titled "Tables"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; } Methods
Section titled "Methods"Unprotect(string)
Section titled "Unprotect(string)"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
Unprotect(SecureString)
Section titled "Unprotect(SecureString)"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
MoveToSheetIndex(int)
Section titled "MoveToSheetIndex(int)"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
Unprotect()
Section titled "Unprotect()"Inherited from: Sheet
Removes the Sheet protection.
public void Unprotect() Returns any
DeleteCells(WorksheetRegion, bool)
Section titled "DeleteCells(WorksheetRegion, bool)"Deletes a region of cells.
public void DeleteCells(WorksheetRegion region, bool shiftCellsLeft) Parameters
- region:
WorksheetRegion - shiftCellsLeft:
bool
Returns any
DeleteCells(string, bool)
Section titled "DeleteCells(string, bool)"Deletes a region of cells.
public void DeleteCells(string address, bool shiftCellsLeft) Parameters
- address:
string - shiftCellsLeft:
bool
Returns any
GetCell(string)
Section titled "GetCell(string)"Gets the cell at the specified address or name.
public WorksheetCell GetCell(string address) Parameters
- address:
string
Returns any
GetCell(string, CellReferenceMode)
Section titled "GetCell(string, CellReferenceMode)"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
GetCell(string, WorksheetCell)
Section titled "GetCell(string, WorksheetCell)"Gets the cell at the specified address or name.
public WorksheetCell GetCell(string address, WorksheetCell originCell) Parameters
- address:
string - originCell:
WorksheetCell
Returns any
GetCellConditionalFormat(int, int)
Section titled "GetCellConditionalFormat(int, int)"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
GetRegion(string)
Section titled "GetRegion(string)"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
GetRegion(string, WorksheetCell)
Section titled "GetRegion(string, WorksheetCell)"Gets the region at the specified address or name.
public WorksheetRegion GetRegion(string address, WorksheetCell originCell) Parameters
- address:
string - originCell:
WorksheetCell
Returns any
GetRegions(string)
Section titled "GetRegions(string)"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
GetRegions(string, WorksheetCell)
Section titled "GetRegions(string, WorksheetCell)"Gets the regions at the specified address or name.
public WorksheetRegion[] GetRegions(string address, WorksheetCell originCell) Parameters
- address:
string - originCell:
WorksheetCell
Returns any
HideColumns(int?, int?)
Section titled "HideColumns(int?, int?)"Hides the columns in the specified range.
public void HideColumns(int? startIndex = null, int? count = null) Parameters
- startIndex:
int? - count:
int?
Returns any
HideRows(int?, int?)
Section titled "HideRows(int?, int?)"Hides the rows in the specified range.
public void HideRows(int? startIndex = null, int? count = null) Parameters
- startIndex:
int? - count:
int?
Returns any
InsertCells(WorksheetRegion, bool)
Section titled "InsertCells(WorksheetRegion, bool)"Inserts a region of cells.
public void InsertCells(WorksheetRegion region, bool shiftCellsRight) Parameters
- region:
WorksheetRegion - shiftCellsRight:
bool
Returns any
InsertCells(string, bool)
Section titled "InsertCells(string, bool)"Inserts a region of cells.
public void InsertCells(string address, bool shiftCellsRight) Parameters
- address:
string - shiftCellsRight:
bool
Returns any
MoveToIndex(int)
Section titled "MoveToIndex(int)"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
UnhideColumns(int?, int?)
Section titled "UnhideColumns(int?, int?)"Unhides the columns in the specified range.
public void UnhideColumns(int? startIndex = null, int? count = null) Parameters
- startIndex:
int? - count:
int?
Returns any
UnhideRows(int?, int?)
Section titled "UnhideRows(int?, int?)"Unhides the rows in the specified range.
public void UnhideRows(int? startIndex = null, int? count = null) Parameters
- startIndex:
int? - count:
int?