Spread Windows Forms 10.0 Product Documentation
Value Property (CalcError)
Example 


Occurs when the wrong type of argument or operand is used.
Syntax
'Declaration
 
Public Shared ReadOnly Property Value As CalcError
'Usage
 
Dim value As CalcError
 
value = CalcError.Value
public static CalcError Value {get;}

Property Value

CalcError object containing this type of error
Example
This example returns the error value.
//Spread for Windows Forms
FarPoint.CalcEngine.ErrorExpression err = new FarPoint.CalcEngine.ErrorExpression(FarPoint.CalcEngine.CalcError.Value);
fpSpread1.ActiveSheet.AddCustomName("Alpha", err);
fpSpread1.ActiveSheet.SetFormula(0, 0, "Alpha * 10");
FarPoint.CalcEngine.Expression expr = fpSpread1.ActiveSheet.GetCustomName("Alpha"); 
if (expr is FarPoint.CalcEngine.ErrorExpression) 
{ 
FarPoint.CalcEngine.ErrorExpression ex = ((FarPoint.CalcEngine.ErrorExpression)(expr)); 
MessageBox.Show("The error is " + ex.ErrorValue.ToString()); 
}
//Spread for Web Forms
FarPoint.CalcEngine.ErrorExpression err = new FarPoint.CalcEngine.ErrorExpression(FarPoint.CalcEngine.CalcError.Value);
FarPoint.Web.Spread.Model.DefaultSheetDataModel dataModel = new FarPoint.Web.Spread.Model.DefaultSheetDataModel();  
dataModel = (FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
dataModel.AddCustomName("Alpha", err);
FpSpread1.Sheets[0].SetFormula(0, 0, "Alpha * 10");
FarPoint.CalcEngine.Expression expr = dataModel.GetCustomName("Alpha"); 
if (expr is FarPoint.CalcEngine.ErrorExpression) 
{ 
FarPoint.CalcEngine.ErrorExpression ex = ((FarPoint.CalcEngine.ErrorExpression)(expr)); 
TextBox1.Text = "The error is " + ex.ErrorValue.ToString(); 
}
'Spread for Windows Forms
Dim err As New FarPoint.CalcEngine.ErrorExpression(FarPoint.CalcEngine.CalcError.Value)
FpSpread1.ActiveSheet.AddCustomName("Alpha", err)
FpSpread1.ActiveSheet.SetFormula(0, 0, "Alpha")
Dim expr As FarPoint.CalcEngine.Expression = FpSpread1.ActiveSheet.GetCustomName("Alpha")
If TypeOf expr Is FarPoint.CalcEngine.ErrorExpression Then
Dim ex As FarPoint.CalcEngine.ErrorExpression = CType(expr, FarPoint.CalcEngine.ErrorExpression)
MessageBox.Show("The error is " & ex.ErrorValue.ToString())
End If
'Spread for Web Forms
Dim err As New FarPoint.CalcEngine.ErrorExpression(FarPoint.CalcEngine.CalcError.Value)
Dim dataModel As New FarPoint.Web.Spread.Model.DefaultSheetDataModel
dataModel = FpSpread1.ActiveSheetView.DataModel
dataModel.AddCustomName("Alpha", err)
FpSpread1.Sheets(0).SetFormula(0, 0, "Alpha")
Dim expr As FarPoint.CalcEngine.Expression = dataModel.GetCustomName("Alpha")
If TypeOf expr Is FarPoint.CalcEngine.ErrorExpression Then
Dim ex As FarPoint.CalcEngine.ErrorExpression = CType(expr, FarPoint.CalcEngine.ErrorExpression)
TextBox1.Text = "The error is " & ex.ErrorValue.ToString()
End If
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

CalcError Class
CalcError Members

 

 


Copyright © GrapeCity, inc. All rights reserved.