CellValue.Value

CellValue.Value property

Gets/sets the cell value.

public object Value { get; set; }

Remarks

The value must be of the correct type of object corresponding to the Type:

TypeValue
IsNullnull, any other object will be ignored
IsNumericdouble
IsDateTimeDateTime
IsStringstring
IsBoolbool
IsErrorerror string such as “#VALUE!”, “#NAME?”, …

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class CellValuePropertyValueDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            CellValue cellValue = new CellValue();
            cellValue.Type = CellValueType.IsNumeric;
            cellValue.Value = 123.45;

            worksheet.Cells["A1"].PutValue(cellValue.Value);

            workbook.Save("CellValueDemo.xlsx");
        }
    }
}

See Also