Message-ID: <239470547.7859.1711624344349.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7858_888037771.1711624344349" ------=_Part_7858_888037771.1711624344349 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Cell

Cell

Description

=20

A Cell object represents a single cel= l in a worksheet. To return a Cell object use Worksheet.Cells. Specify the cell by 0-based = row and column indexes or by Excel-style reference:

=20
C#
=20
 public sealed class Cell
=20
=20
vb.net
=20
Public NotInheritable Class Cell
=20
=20

Examples

=20
C#
=20

          //--- Get Cell by Excel-style reference
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();
          Worksheet ws =3D wb.Worksheets[0];
          Cell cellA1 =3D ws.Cells[0,0];

          //--- Get Cell by Excel-style reference
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();
          Worksheet ws =3D wb.Worksheets[0];
          Cell cellA1 =3D ws.Cells["A1"];
        
=20
=20
vb.net
=20

          '--- Get Cell by Excel-style reference
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          Dim ws As Worksheet =3D wb.Worksheets(0)
          Dim cellA1 As Cell =3D ws.Cells(0, 0)

          '--- Get Cell by Excel-style reference
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          Dim ws As Worksheet =3D wb.Worksheets(0)
          Dim cellA1 As Cell =3D ws.Cells("A1")
        
=20
=20

Properties

=20
=20 =20 =20 =20 =20 =20 =20 = =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

C= olumnNumber

Returns the cell's 0-based column number.

Commen= t

Returns a Comm= ent object representing a note attached to the cell, separate from othe= r cell content. If a comment is not associated with the specified cell, a n= ew comment will be created and returned.

ConditionalFormat

Returns the ConditionalFormat object associated with the current Cell. If a ConditionalFormat object does not exist, a new one will be created= . Any changes made to the object returned will only affect this Cell<= /code>.

DataValidation

Returns the cell's DataValidation object if one exists. Otherwise, returns 'nu= ll'.

Formul= a

Sets or returns a cell formula. If no formula is= associated with the cell, the property returns an empty string.

Has= Comment

Returns true if a Comment object is associated with the cell.

HasConditionalFormat

Returns whether or not the Cell contains a C= onditionalFormat object.

HasDataValidation

Returns true if the cell has a DataValidation object associated w= ith it.

IsMer= ged

Returns whether or not the Cell is a merged cell.

Name<= /p>

Returns the cell's Excel-style name (such as, &q= uot;B5").

RowN= umber

Returns the cell's 0-based row number.

Style

Sets or returns a Style object that determines how the cell looks, including number for= mat, font, orientation, etc. Accessing the cell's style through Cell.Style will not affect the formatting of = other cells with the same global style.

Value

Sets or returns a cell value.  Empty cells = will return either null or empty string.

Valu= eType

Returns the data type of the cell's value: "= ;Blank, "Boolean", "Date", "Error", "Num= eric", or "Text".
=20

Methods

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20

Name

Description

ApplyStyle(Style)

Applies a style to the cell. When a style is app= lied - rather than set (see Cell.Style= ) - only the differences between the new style and style properties pr= eviously assigned to the cell (through the ExcelWriter API) will take effec= t. For example, if the cell has a background color and the new style applie= d does not contain a background color, the cell's color will not be affecte= d. However, if the new style includes a background color, it will replace t= he existing background color of the cell.

ClearContent()

Clears a cell's content. Calling this method is = equivalent to setting a cell's value to null.

ClearRichTextFormatting()

Clears all rich text formatting within the cell.= The font of the text will be set to that set in Cell.Style.Font.

CreateAnchor(Int32, Int32)

Creates an anchor within the specified cell. An = anchor represents the position of a floating (non-cell data) object within = a spreadsheet.

CreateHyperlink(String)

Creates a new hyperlink in the cell pointing to = the specified href. This hyperlink is automatically added to the worksheet.= The cell value will be converted to hyperlinks.

GetCharacters(Int32)

Returns a CharacterRun object representing a range of characters within the cell= . Use this property to set the font on specified characters within the cell= .

GetCharacters(Int32, Int32)

Returns a CharacterRun object representing a range of characters within the cell= . Use this method to set the font on specified characters within the cell.<= /td>=20

RemoveComment()

Removes the comment associated with the cell. A = comment is a note attached to the cell, separate from other cell content. T= o find out if a comment is attached to the cell, use Cell.HasComment .

RemoveConditionalFormat()

Removes any ConditionalFormat objects from the current Cell.

RemoveDataValidation()

Removes the DataValidation object associated with the cell.

SetConditionalFormat(ConditionalFormat)

Applies the specified ConditionalFormat to the current
Cell. If the cell already has a ConditionalFormat, it will be replaced by the spe= cified
ConditionalFormat.

ToString()

Returns a string representation of the Cell object.

Unmerge()

Unmerges the current cell. A merged cell is refe= renced using the location of the leftmost, topmost constituent cell.
=20

Nested Classes

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

= CellValueType

A C= ellValueType value specifies the data type of the cell's value.
------=_Part_7858_888037771.1711624344349--