NanoXLSX Library Documentation
![]() | Worksheet Class |
Class representing a worksheet of a workbook

Namespace: NanoXLSX
Assembly: NanoXLSX (in NanoXLSX.dll) Version: 1.2.3.0 (1.2.3)

C#
public class Worksheet
The Worksheet type exposes the following members.

Name | Description | |
---|---|---|
![]() | Worksheet |
Default Constructor
|
![]() | Worksheet(String, Int32, Workbook) |
Constructor with name and sheet ID
|

Name | Description | |
---|---|---|
![]() | AutoFilterRange |
Gets the range of the auto-filter. Wrapped to Nullable to provide null as value. If null, no auto-filter is applied
|
![]() | Cells |
Gets the cells of the worksheet as dictionary with the cell address as key and the cell object as value
|
![]() | Columns |
Gets all columns with non-standard properties, like auto filter applied or a special width as dictionary with the zero-based column index as key and the column object as value
|
![]() | CurrentCellDirection |
Gets or sets the direction when using AddNextCell method
|
![]() | DefaultColumnWidth |
Gets or sets the default column width
|
![]() | DefaultRowHeight |
Gets or sets the default Row height
|
![]() | HiddenRows |
Gets the hidden rows as dictionary with the zero-based row number as key and a boolean as value. True indicates hidden, false visible.
|
![]() | MergedCells |
Gets the merged cells (only references) as dictionary with the cell address as key and the range object as value
|
![]() | RowHeights |
Gets defined row heights as dictionary with the zero-based row number as key and the height (float from 0 to 409.5) as value
|
![]() | SelectedCells |
Gets the cell range of selected cells of this worksheet. Null if no cells are selected
|
![]() | SheetID |
Gets or sets the internal ID of the sheet
|
![]() | SheetName |
Gets or sets the name of the worksheet
|
![]() | SheetProtectionPassword |
Gets the password used for sheet protection
|
![]() | SheetProtectionValues |
Gets the list of SheetProtectionValues. These values define the allowed actions if the worksheet is protected
|
![]() | UseSheetProtection |
Gets or sets whether the worksheet is protected. If true, protection is enabled
|
![]() | WorkbookReference |
Gets or sets the Reference to the parent Workbook
|

Name | Description | |
---|---|---|
![]() | AddAllowedActionOnSheetProtection |
Method to add allowed actions if the worksheet is protected. If one or more values are added, UseSheetProtection will be set to true
|
![]() | AddCell(Object, String) |
Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
|
![]() | AddCell(Object, Int32, Int32) |
Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
|
![]() | AddCell(Object, String, Style) |
Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
|
![]() | AddCell(Object, Int32, Int32, Style) |
Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
|
![]() | AddCellFormula(String, String) |
Adds a cell formula as string to the defined cell address
|
![]() | AddCellFormula(String, Int32, Int32) |
Adds a cell formula as string to the defined cell address
|
![]() | AddCellFormula(String, String, Style) |
Adds a cell formula as string to the defined cell address
|
![]() | AddCellFormula(String, Int32, Int32, Style) |
Adds a cell formula as string to the defined cell address
|
![]() | AddCellRange(ListObject, String) |
Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
|
![]() | AddCellRange(ListObject, CellAddress, CellAddress) |
Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
|
![]() | AddCellRange(ListObject, String, Style) |
Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
|
![]() | AddCellRange(ListObject, CellAddress, CellAddress, Style) |
Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
|
![]() | AddCellRangeInternalT |
Internal function to add a generic list of value to the defined cell range
|
![]() | AddHiddenColumn(Int32) |
Sets the defined column as hidden
|
![]() | AddHiddenColumn(String) |
Sets the defined column as hidden
|
![]() | AddHiddenRow |
Sets the defined row as hidden
|
![]() | AddNextCell(Object) |
Adds an object to the next cell position. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
|
![]() | AddNextCell(Object, Style) |
Adds an object to the next cell position. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
|
![]() | AddNextCell(Cell, Boolean, Style) |
Method to insert a generic cell to the next cell position
|
![]() | AddNextCellFormula(String) |
Adds a formula as string to the next cell position
|
![]() | AddNextCellFormula(String, Style) |
Adds a formula as string to the next cell position
|
![]() | CastValue |
Method to cast a value or align an object of the type Cell to the context of the worksheet
|
![]() | ClearActiveStyle |
Clears the active style of the worksheet. All later added calls will contain no style unless another active style is set
|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetCell(CellAddress) |
Gets the cell of the specified address
|
![]() | GetCell(Int32, Int32) |
Gets the cell of the specified column and row number (zero-based)
|
![]() | GetCurrentColumnNumber |
Gets the current column number (zero based)
|
![]() | GetCurrentRowNumber |
Gets the current row number (zero based)
|
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetLastAddress |
Gets the last existing row or column number of the current worksheet (zero-based)
|
![]() | GetLastColumnNumber |
Gets the last existing column number in the current worksheet (zero-based)
|
![]() | GetLastRowNumber |
Gets the last existing row number in the current worksheet (zero-based)
|
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GoToNextColumn |
Moves the current position to the next column
|
![]() | GoToNextColumn(Int32) |
Moves the current position to the next column with the number of cells to move
|
![]() | GoToNextRow |
Moves the current position to the next row (use for a new line)
|
![]() | GoToNextRow(Int32) |
Moves the current position to the next row with the number of cells to move (use for a new line)
|
![]() | HasCell(CellAddress) |
Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address
|
![]() | HasCell(Int32, Int32) |
Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address
|
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | MergeCells(String) |
Merges the defined cell range
|
![]() | MergeCells(CellRange) |
Merges the defined cell range
|
![]() | MergeCells(CellAddress, CellAddress) |
Merges the defined cell range
|
![]() | RecalculateAutoFilter |
Method to recalculate the auto filter (columns) of this worksheet. This is an internal method. There is no need to use it. It must be public to require access from the LowLevel class
|
![]() | RecalculateColumns |
Method to recalculate the collection of columns of this worksheet. This is an internal method. There is no need to use it. It must be public to require access from the LowLevel class
|
![]() | RemoveAutoFilter |
Removes auto filters from the worksheet
|
![]() | RemoveCell(String) |
Removes a previous inserted cell at the defined address
|
![]() | RemoveCell(Int32, Int32) |
Removes a previous inserted cell at the defined address
|
![]() | RemoveHiddenColumn(Int32) |
Sets a previously defined, hidden column as visible again
|
![]() | RemoveHiddenColumn(String) |
Sets a previously defined, hidden column as visible again
|
![]() | RemoveHiddenRow |
Sets a previously defined, hidden row as visible again
|
![]() | RemoveMergedCells |
Removes the defined merged cell range
|
![]() | RemoveSelectedCells |
Removes the cell selection of this worksheet
|
![]() ![]() | SanitizeWorksheetName |
Sanitizes a worksheet name
|
![]() | SetActiveStyle |
Sets the active style of the worksheet. This style will be assigned to all later added cells
|
![]() | SetAutoFilter(String) |
Sets the column auto filter within the defined column range
|
![]() | SetAutoFilter(Int32, Int32) |
Sets the column auto filter within the defined column range
|
![]() | SetColumnHiddenState |
Sets the defined column as hidden or visible
|
![]() | SetColumnWidth(Int32, Single) |
Sets the width of the passed column number (zero-based)
|
![]() | SetColumnWidth(String, Single) |
Sets the width of the passed column address
|
![]() | SetCurrentCellAddress(String) |
Set the current cell address
|
![]() | SetCurrentCellAddress(Int32, Int32) |
Set the current cell address
|
![]() | SetCurrentColumnNumber |
Sets the current column number (zero based)
|
![]() | SetCurrentRowNumber |
Sets the current row number (zero based)
|
![]() | SetRowHeight |
Sets the height of the passed row number (zero-based)
|
![]() | SetRowHiddenState |
Sets the defined row as hidden or visible
|
![]() | SetSelectedCells(String) |
Sets the selected cells on this worksheet
|
![]() | SetSelectedCells(CellRange) |
Sets the selected cells on this worksheet
|
![]() | SetSelectedCells(CellAddress, CellAddress) |
Sets the selected cells on this worksheet
|
![]() | SetSheetname |
Validates and sets the worksheet name
|
![]() | SetSheetName |
Sets the name of the sheet
|
![]() | SetSheetProtectionPassword |
Sets or removes the password for worksheet protection. If set, UseSheetProtection will be also set to true
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() ![]() | WorksheetExists |
Checks whether a worksheet with the given name exists
|

Name | Description | |
---|---|---|
![]() ![]() | DEFAULT_COLUMN_WIDTH |
Default column width as constant
|
![]() ![]() | DEFAULT_ROW_HEIGHT |
Default row height as constant
|
![]() ![]() | MAX_COLUMN_NUMBER |
Maximum column number (zero-based) as constant
|
![]() ![]() | MAX_COLUMN_WIDTH |
Maximum column width as constant
|
![]() ![]() | MAX_ROW_HEIGHT |
Maximum row height as constant
|
![]() ![]() | MAX_ROW_NUMBER |
Maximum row number (zero-based) as constant
|
![]() ![]() | MIN_COLUMN_NUMBER |
Minimum column number (zero-based) as constant
|
![]() ![]() | MIN_COLUMN_WIDTH |
Minimum column width as constant
|
![]() ![]() | MIN_ROW_HEIGHT |
Minimum row height as constant
|
![]() ![]() | MIN_ROW_NUMBER |
Minimum row number (zero-based) as constant
|
