CellValue class

Office 2013 and later

Cell Value. When the object is serialized out as xml, its qualified name is x:v.

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

No code example is currently available or this language may not be supported.

[ISO/IEC 29500-1 1st Edition]

v (Cell Value)

This element expresses the value contained in a cell. If the cell contains a string, then this value is an index into the shared string table, pointing to the actual string value. Otherwise, the value of the cell is expressed directly in this element. Cells containing formulas express the last calculated result of the formula in this element.

For applications not wanting to implement the shared string table, an 'inline string' can be expressed in an <is> element under <c> (instead of a <v> element under <c>),in the same way a string would be expressed in the shared string table. [Note: See <is> for an example. end note]

[Example:In this example cell B4 contains the number "360" and C4 contains the UTC date 22 November 1976, 08:30.

<c r="B4">
  <v>360</v>
</c>
<c r="C4" t="d">
  <v>1976-11-22T08:30Z</v>
</c>
 

end example]

The possible values for this element are defined by the ST_Xstring simple type (§22.9.2.19).

Parent Elements

c (§18.3.1.4); cell (§18.14.1); nc (§18.11.1.3); oc (§18.11.1.5); tp (§18.15.3)

[Note: The W3C XML Schema definition of this element’s content model (ST_Xstring) is located in §A.6.9. end note]

© ISO/IEC29500: 2008.

The following code example creates a spreadsheet file named "CellValue.xlsx" and writes the text "Microsoft" in the cell A2.

No code example is currently available or this language may not be supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: