Worksheet Class
Encapsulates the object that represents a single worksheet.
Inheritance Hierarchy
SystemObject
  Aspose.CellsWorksheet

Namespace: Aspose.Cells
Assembly: Aspose.Cells (in Aspose.Cells.dll) Version: 19.11.0.0 (19.11)
Syntax
public class Worksheet : IDisposable

The Worksheet type exposes the following members.

Properties
  NameDescription
Public propertyActiveCell
Gets or sets the active cell in the worksheet.
Public propertyAllowEditRanges
Gets the allow edit range collection in the worksheet.
Public propertyAutoFilter
Represents auto filter for the specified worksheet.
Public propertyBackgroundImage
Gets and sets worksheet background image.
Public propertyCells
Gets the Cells collection.
Public propertyCellWatches
Gets collection of cells on this worksheet being watched in the 'watch window'.
Public propertyCharts
Gets a Chart collection
Public propertyCheckBoxes
Gets a CheckBox collection.
Public propertyCodeName
Gets worksheet code name.
Public propertyComments
Gets the Comment collection.
Public propertyConditionalFormattings
Gets the ConditionalFormattings in the worksheet.
Public propertyCustomProperties
Gets an object representing the identifier information associated with a worksheet.
Public propertyDisplayRightToLeft
Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.
Public propertyDisplayZeros
True if zero values are displayed.
Public propertyErrorCheckOptions
Gets error check setting applied on certain ranges.
Public propertyFirstVisibleColumn
Represents first visible column index.
Public propertyFirstVisibleRow
Represents first visible row index.
Public propertyHasAutofilter
Indicates whether this worksheet has auto filter.
Public propertyHorizontalPageBreaks
Gets the HorizontalPageBreakCollection collection.
Public propertyHyperlinks
Gets the HyperlinkCollection collection.
Public propertyIndex
Gets the index of sheet in the worksheet collection.
Public propertyIsGridlinesVisible
Gets or sets a value indicating whether the gridelines are visible.Default is true.
Public propertyIsOutlineShown
Indicates whether to show outline.
Public propertyIsPageBreakPreview
Indicates whether the specified worksheet is shown in normal view or page break preview.
Public propertyIsProtected
Indicates if the worksheet is protected.
Public propertyIsRowColumnHeadersVisible
Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true.
Public propertyIsRulerVisible
Indicates whether the ruler is visible. This property is only applied for page break preview.
Public propertyIsSelected
Indicates whether this worksheet is selected when the workbook is opened.
Public propertyIsVisible
Represents if the worksheet is visible.
Public propertyListObjects
Gets all ListObjects in this worksheet.
Public propertyName
Gets or sets the name of the worksheet.
Public propertyOleObjects
Represents a collection of OleObject in a worksheet.
Public propertyOutline
Gets the outline on this worksheet.
Public propertyPageSetup
Represents the page setup description in this sheet.
Public propertyPictures
Gets a Picture collection.
Public propertyPivotTables
Gets all pivot tables in this worksheet.
Public propertyProtection
Represents the various types of protection options available for a worksheet. Supports advanced protection options in ExcelXP and above version.
Public propertyQueryTables
Gets the queryTables in the worksheet.
Public propertyScenarios
Gets the collection of Scenario.
Public propertyShapes
Returns all drawing shapes in this worksheet.
Public propertyShowFormulas
Indicates whether to show formulas or their results.
Public propertySlicers
Get the Slicer collection in the worksheet
Public propertySmartTagSetting
Gets all SmartTagCollection objects of the worksheet.
Public propertySparklineGroupCollection
Gets the sparkline group collection in the worksheet.
Public propertyTabColor
Represents worksheet tab color.
Public propertyTabId
Specifies the internal identifier for the sheet.
Public propertyTextBoxes
Gets a TextBox collection.
Public propertyTransitionEntry
Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled.
Public propertyTransitionEvaluation
Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.
Public propertyType
Represents worksheet type.
Public propertyValidations
Gets the data validation setting collection in the worksheet.
Public propertyVerticalPageBreaks
Gets the VerticalPageBreakCollection collection.
Public propertyViewType
Gets and sets the view type.
Public propertyVisibilityType
Indicates the visible state for this sheet.
Public propertyWorkbook
Gets the workbook object which contains this sheet.
Public propertyZoom
Represents the scaling factor in percentage. It should be between 10 and 400.
Methods
  NameDescription
Public methodAddPageBreaks
Adds page break.
Public methodAdvancedFilter
Filters data using complex criteria.
Public methodAutoFitColumn(Int32)
Autofits the column width.
Public methodAutoFitColumn(Int32, Int32, Int32)
Autofits the column width.
Public methodAutoFitColumns
Autofits all columns in this worksheet.
Public methodAutoFitColumns(AutoFitterOptions)
Autofits all columns in this worksheet.
Public methodAutoFitColumns(Int32, Int32)
Autofits the columns width.
Public methodAutoFitColumns(Int32, Int32, AutoFitterOptions)
Autofits the columns width.
Public methodAutoFitColumns(Int32, Int32, Int32, Int32)
Autofits the columns width.
Public methodAutoFitColumns(Int32, Int32, Int32, Int32, AutoFitterOptions)
Autofits the columns width.
Public methodAutoFitRow(Int32)
Autofits the row height.
Public methodAutoFitRow(Int32, Int32, Int32)
Autofits the row height.
Public methodAutoFitRow(Int32, Int32, Int32, AutoFitterOptions)
Autofits the row height.
Public methodAutoFitRow(Int32, Int32, Int32, Int32)
Autofits row height in a rectangle range.
Public methodAutoFitRows
Autofits all rows in this worksheet.
Public methodAutoFitRows(Boolean)
Autofits all rows in this worksheet.
Public methodAutoFitRows(AutoFitterOptions)
Autofits all rows in this worksheet.
Public methodAutoFitRows(Int32, Int32)
Autofits row height in a range.
Public methodAutoFitRows(Int32, Int32, AutoFitterOptions)
Autofits row height in a range.
Public methodCalculateFormula(String)
Calculates a formula.
Public methodCalculateFormula(String, CalculationOptions)
Calculates a formula.
Public methodCalculateFormula(CalculationOptions, Boolean)
Calculates all formulas in this worksheet.
Public methodCalculateFormula(Boolean, Boolean, ICustomFunction)
Calculates all formulas in this worksheet.
Public methodClearComments
Clears all comments in designer spreadsheet.
Public methodCopy(Worksheet)
Copies contents and formats from another worksheet.
Public methodCopy(Worksheet, CopyOptions)
Copies contents and formats from another worksheet.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFreezePanes(String, Int32, Int32)
Freezes panes at the specified cell in the worksheet.
Public methodFreezePanes(Int32, Int32, Int32, Int32)
Freezes panes at the specified cell in the worksheet.
Public methodGetFreezedPanes
Gets the freeze panes.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetPanes
Gets the window panes.
Public methodGetPrintingPageBreaks
Gets automatic page breaks.
Public methodGetSelectedRanges
Gets selected ranges of cells in the designer spreadsheet.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMoveTo
Moves the sheet to another location in the spreadsheet.
Public methodProtect(ProtectionType)
Protects worksheet.
Public methodCode exampleProtect(ProtectionType, String, String)
Protects worksheet.
Public methodRefreshPivotTables
Refreshes all PivotTables in this Worksheet.
Public methodRemoveAllDrawingObjects
Removes all drawing objects in this worksheet.
Public methodRemoveAutoFilter
Removes the auto filter of the worksheet.
Public methodRemoveSplit
Removes splitted window.
Public methodReplace
Replaces all cells' text with a new string.
Public methodSelectRange
Selects a range.
Public methodSetBackground Obsolete.
Sets worksheet background image.
Public methodSetVisible
Sets the visible options.
Public methodSplit
Splits window.
Public methodToString
Returns a string represents the current Worksheet object.
Public methodUnFreezePanes
Unfreezes panes in the worksheet.
Public methodUnprotect
Unprotects worksheet.
Public methodUnprotect(String)
Unprotects worksheet.
Public methodXmlMapQuery
Query cell areas that mapped/linked to the specific path of xml map.
Examples
[C#]

Workbook workbook = new Workbook();

Worksheet sheet = workbook.Worksheets[0];

//Freeze panes at "AS40" with 10 rows and 10 columns
sheet.FreezePanes("AS40", 10, 10);

//Add a hyperlink in Cell A1
sheet.Hyperlinks.Add("A1", 1, 1, "http://www.aspose.com");

[Visual Basic]

Dim workbook as Workbook = new Workbook()

Dim sheet as Worksheet = workbook.Worksheets(0)

'Freeze panes at "AS40" with 10 rows and 10 columns
sheet.FreezePanes("AS40", 10, 10)

'Add a hyperlink in Cell A1
sheet.Hyperlinks.Add("A1", 1, 1, "http://www.aspose.com")
See Also