Enum ErrorCellValueType

ErrorCellValueType enumeration

Represents a cell value which contains an error.

public enum ErrorCellValueType

Values

NameValueDescription
Blocked10Represents the value of a cell containing a #BLOCKED! error.
Busy14Represents the value of a cell containing a #BUSY! error.
Calc13Represents the value of a cell containing a #CALC! error.
Connect9Represents the value of a cell containing a #CONNECT! error.
Name4Represents the value of a cell containing a #NAME? error.
Field12Represents the value of a cell containing a #FIELD! error.
Spill8Represents the value of a cell containing a #SPILL! error.
Unknown11Represents the value of a cell containing a #UNKNOWN! error.
TimeOut19Represents the value of a cell containing a #TIMEOUT! error.
External18Represents the value of a cell containing an #EXTERNAL! error.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class CellsClassErrorCellValueTypeDemo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            
            // Access first worksheet
            Worksheet worksheet = workbook.Worksheets[0];
            
            // Set a formula that will result in a spill error
            worksheet.Cells["A1"].Formula = "=UNIQUE({1,2,3;1,2,3})";
            
            try
            {
                // Calculate formulas to trigger the error
                workbook.CalculateFormula();
            }
            catch (Exception)
            {
                // Expected spill error
            }
            
            // Get the cell's rich value
            CellRichValue richValue = worksheet.Cells["A1"].GetRichValue();
            
            // Check the error type
            if (richValue.ErrorValue == ErrorCellValueType.Spill)
            {
                Console.WriteLine("Cell contains a spill error as expected");
            }
            
            // Save the workbook
            workbook.Save("ErrorCellValueTypeDemo.xlsx");
        }
    }
}

See Also