Click or drag to resize

XlsWorksheetBase Class

Represents the base class for Excel worksheet operations.
Inheritance Hierarchy

Namespace: Spire.Xls.Core.Spreadsheet
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public abstract class XlsWorksheetBase : XlsObject, 
	INamedObject, ITabSheet, IExcelApplication, ICloneParent

The XlsWorksheetBase type exposes the following members.

Properties
Name Description
Public property ArcShapes
Gets the collection of arc shapes in the worksheet.
Public property ButtonShapes
Gets the collection of button shapes in the worksheet.
Public property CellImages
Cell image array. Read-only.
Public property Charts
Returns charts collection. Read-only.
Public property CheckBoxes
Returns inner checkboxes collection. Read-only.
Public property CodeName
Name used by macros to access workbook items.
Public property ComboBoxes
Returns collection with all comboboxes inside this worksheet. Read-only.
Public property Comments
Returns comments collection for this worksheet. Read-only.
Public property DefaultGridlineColor
Indicates whether gridline color has default value.
Public property FirstColumn
Gets or sets index of the first column of the worksheet.
Public property FirstDataColumn
Gets index of the first data column of the worksheet.
Public property FirstDataRow
Gets index of the first data row of the worksheet.
Public property FirstRow
Gets / sets index of the first row of the worksheet.
Public property Code example GridLineColor
Grid line color.
Examples
The following code illustrates how to set the grid line color:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set grid lines color</para><para>worksheet.GridLineColor = ExcelColors.Red;</para><para>//Save to file</para><para>workbook.SaveToFile("GridLineColor.xlsx");</para>
Public property GroupBoxes
Gets the group boxes in the worksheet.
Public property GroupShapeCollection
Get group shapes in worksheet.
Public property HasPictures
Indicates whether tabsheet contains any picture. Read-only.
Public property HasVmlShapes
Indicates whether worksheet has vml shapes. Read-only.
Public property HeaderFooterShapes
Header / footer shapes collection.
Public property Index
Returns the index number of the object within the collection of objects.
Public property IsPasswordProtected
True if the worksheet has been protected with password.
Public property IsRightToLeft
Indicates whether worksheet is displayed right to left.
Public property IsRowColHeadersVisible
Gets or sets whether the worksheet will display row and column headers. Default is true.
Public property IsSelected
Indicates whether tab of this sheet is selected. Read-only.
Public property IsTransitionEvaluation
Gets or sets a value indicating whether transition evaluation is enabled.
Public property LabelShapes
Gets the collection of label shapes in the worksheet.
Public property LastColumn
Gets or sets index of the last column of the worksheet.
Public property LastDataColumn
Gets index of the last data column of the worksheet.
Public property LastDataRow
Gets index of the last data row of the worksheet.
Public property LastRow
Gets or sets one-based index of the last row of the worksheet.
Public property Code example LeftVisibleColumn
Gets/sets left visible column of the worksheet.
Examples
The following code illustrates how to set the left visible column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set left visible column</para><para>worksheet.LeftVisibleColumn = 3;</para><para>//Get left visible column</para><para>Console.Write(worksheet.LeftVisibleColumn);</para><para>//Save to file</para><para>workbook.SaveToFile("LeftVisibleColumn.xlsx");</para>
Public property Lines
Gets the lines of the chart.
Public property ListBoxes
Gets the list of list boxes in the workbook.
Public property Name
Returns or sets the name of the object. Read / write String.
Public property OvalShapes
Gets the oval shapes in the worksheet.
Public property Parent
Reference to Parent object. Read-only.
(Inherited from XlsObject .)
Public property ParentWorkbook
Returns parent workbook. Read-only.
Public property Pictures
Pictures collection. Read-only.
Public property ProtectContents
Indicates is current sheet is protected.
Public property ProtectDrawingObjects
True if objects are protected. Read only.
Public property Protection
Gets protected options. Read-only. For sets protection options use "Protect" method.
Public property ProtectScenarios
True if the scenarios of the current sheet are protected. Read only.
Public property PrstGeomShapes
Gets the collection of preset geometric shapes.
Public property QueryTables
Gets the collection of query tables in the worksheet.
Public property RadioButtons
Returns inner radiobutton collection. Read-only.
Public property RealIndex
Index of the worksheet in the workbook (not necessary in Worksheets collection)
Public property RectangleShapes
Gets the rectangle shapes in the worksheet.
Protected property ReferenceCount
Get quantity of instance references.
(Inherited from XlsObject .)
Public property ScrollBarShapes
Gets the scroll bar shapes associated with the worksheet.
Public property Shapes
Shapes collection.
Public property SheetId
Gets or sets sheetId for this sheet.
Public property SpinnerShapes
Gets the spinner shapes in the worksheet.
Public property TabColor
Tab color.
Public property TabColorObject
Tab color.
Public property TabKnownColor
Tab excel color.
Public property TextBoxes
Returns inner textboxes collection. Read-only.
Public property Code example TopVisibleRow
Gets/sets top visible row of the worksheet.
Examples
The following code illustrates how to set the top visible row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set top visible row</para><para>worksheet.TopVisibleRow = 5;</para><para>//Get top visible row</para><para>Console.Write(worksheet.TopVisibleRow);</para><para>//Save to file</para><para>workbook.SaveToFile("TopVisibleRow.xlsx");</para>
Public property TypedArcs
Returns inner Arcs collection. Read-only.
Public property TypedButtons
Returns inner buttons collection. Read-only.
Public property TypedCheckBoxes
Returns inner checkboxes collection. Read-only.
Public property TypedComboBoxes
Returns inner comboboxes collection. Read-only.
Public property TypedGroupBoxes
Returns inner gourpboxes collection. Read-only.
Public property TypedLabels
Returns inner labels collection. Read-only.
Public property TypedLines
Returns inner lines collection. Read-only.
Public property TypedListBoxes
Returns inner listboxes collection. Read-only.
Public property TypedOvals
Returns inner ovals collection. Read-only.
Public property TypedPictures
Returns inner pictures collection. Read-only.
Public property TypedRadioButtons
Returns inner radiobutton collection. Read-only.
Public property TypedRects
Returns inner rects collection. Read-only.
Public property TypedScollBars
Returns inner scollbars collection. Read-only.
Public property TypedSpinners
Returns inner spinners collection. Read-only.
Public property TypedTextBoxes
Returns inner textboxes collection. Read-only.
Public property UnknownVmlShapes
Indicates whether worksheet contains some unknown vml shapes.
Public property Visibility
Controls end user visibility of worksheet.
Public property VmlShapesCount
Returns number of known vml shapes. Read-only.
Public property Workbook
Get parent workbook of current worksheet.
Public property Zoom
Zoom factor of document.
Top
Methods
Name Description
Public method Activate
Makes the current sheet the active sheet. Equivalent to clicking the sheet's tab in MS Excel.
Protected method AddReference
Increase the quantity of reference. User must use this method when new wrapper on object is created or reference on object stored.
(Inherited from XlsObject .)
Public method AddTextEffectShape
Adds a text effect shape to the worksheet.
Protected method CheckDisposed
Checks whether object was disposed and throws exception if it was.
(Inherited from XlsObject .)
Public method ClearCellImageCache
Clear Cell image array cache,not delete CellImage in cell.
Public method Clone Obsolete.
Creates copy of the current object.
Public method Dispose
Dispose object and free resources.
(Inherited from XlsObject .)
Public method Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object .)
Protected method Finalize
Destructor. Call dispose method of current object.
(Inherited from XlsObject .)
Protected method FindParent(Type)
This method is used to find parent with specific type.
(Inherited from XlsObject .)
Protected method FindParent( Type )
Find parent of object.
(Inherited from XlsObject .)
Protected method FindParent(Type, Boolean)
This method is used to find parent with specific type.
(Inherited from XlsObject .)
Protected method FindParents
Finds parent objects.
(Inherited from XlsObject .)
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object .)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object .)
Protected method InitializeCollections
Initializes all required collections.
Protected method MemberwiseClone
Creates a shallow copy of the current Object .
(Inherited from Object .)
Public method MoveSheet
Moves sheet into new position, including chartsheet and worksheet.
Protected method OnDispose
Method which can be overriden by users to take any specific actions when object is disposed.
(Inherited from XlsObject .)
Public method Code example Protect(String)
Protects worksheet with password.protect the sheet except select lock/unlock cells.
Examples
The following code illustrates how to protect the sheet except select lock/unlock cells:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Protects the first worksheet's content with password</para><para>worksheet.Protect("123456");</para><para>//Save to file</para><para>workbook.SaveToFile("Protect.xlsx");</para>
Public method Protect(String, SheetProtectionType)
Protects worksheet with password.
Protected method ReleaseReference
Decrease quantity of Reference. User must call this method when freeing resources.
(Inherited from XlsObject .)
Public method Select
Selects current tab sheet.
Public method SelectTab
Adds sheet tab to the selected tab.
Public method SetChanged
This method should be called after any changes in the worksheet. Sets Saved property of the parent workbook to false.
Protected method SetParent
Sets parent of the object.
(Inherited from XlsObject .)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object .)
Public method Unprotect
Unprotects this wokrsheet.
Public method Unprotect(String)
Unprotects this worksheet using specified password.
Public method Unselect
Unselects current tab sheet if possible.
Public method Unselect(Boolean)
Unselects current tab sheet if possible.
Top
Fields
Name Description
Public field Static member DEF_MIN_COLUMN_INDEX
Defines the default minimum column index as the maximum value of an integer.
Protected field m_bIsDisposed
Flag which indicates if the object was disposed or not.
(Inherited from XlsObject .)
Protected field m_book
Represents the workbook object.
Protected field m_iFirstColumn
The first column index, initialized to the default minimum column index.
Protected field m_iFirstRow
One field from Worksheet dimension records.
Protected field m_iLastColumn
One field from Worksheet dimension records.
Protected field m_iLastRow
One field from Worksheet dimension records
Top
See Also