Class CellValue
Contents
[
Hide
]CellValue class
Represents the cell value and corresponding type.
public class CellValue
Constructors
Name | Description |
---|---|
CellValue() | The default constructor. |
Properties
Name | Description |
---|---|
Type { get; set; } | Gets/sets the type of cell value. |
Value { get; set; } | Gets/sets the cell value. |
Examples
[C#]
namespace Demos
{
using Aspose.Cells;
using System;
public class CellValueDemo
{
public static void CellValueExample()
{
// Create a new workbook and get the first worksheet
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
// Create a CellValue instance
CellValue cellValue = new CellValue();
// Set the type and value of the cell
cellValue.Type = CellValueType.IsNumeric;
cellValue.Value = 123.45;
// Assign the CellValue to a cell in the worksheet
Cell cell = worksheet.Cells["A1"];
cell.PutValue(cellValue.Value);
// Save the workbook
workbook.Save("CellValueExample.xlsx");
workbook.Save("CellValueExample.pdf");
return;
}
}
}
See Also
- namespace Aspose.Cells
- assembly Aspose.Cells