[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.CalcReference.IsExternalReference

IsExternalReference Property

IsExternalReference

Gets whether the reference is in another workbook.

Declaration
public bool IsExternalReference { get; }
Public ReadOnly Property IsExternalReference As Boolean
Examples
CustomFunction function = new RefExternalFunction();
Workbook.AddCustomFunction(function, true);
worksheet.Range["A1:B2"].Value = new object[,] {{1, 2}, {3, 4}};
worksheet.Range["C1"].Formula = "=ISEXTERNALREF(A1:B2)";
object external = worksheet.Range["C1"].Value;

class RefExternalFunction : CustomFunction
{
    public RefExternalFunction()
        : base("ISEXTERNALREF", FunctionValueType.Boolean, new Parameter[] { new Parameter(FunctionValueType.Object, true, false) })
    {
    }

    public override object Evaluate(object[] arguments, ICalcContext context)
    {
        CalcReference reference = (CalcReference)arguments[0];
        return reference.IsExternalReference;
    }
}