ExcelReference
OfficeIMO.Excel
Parsed, format-neutral Excel cell or range reference. Relative R1C1 endpoints are resolved against the anchor supplied to ExcelReference.Parse.
Inheritance
- object
- ExcelReference
Usage
Explore 13 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 6
- Property ExcelFormulaReferenceSyntax.Reference
- Method ExcelReference.BoundingUnion
- Method ExcelReference.Except
- Method ExcelReference.Intersect
- Method ExcelReference.Offset
- Method ExcelReference.Parse
Accepted by parameters 7
- Method ExcelFormulaSyntaxTree.Rewrite
- Method ExcelReference.BoundingUnion
- Method ExcelReference.Equals
- Method ExcelReference.Except
- Method ExcelReference.Intersect
- Method ExcelReference.Intersects
- Method ExcelReference.TryParse
Methods
public ExcelReference BoundingUnion(ExcelReference other) #Returns the smallest rectangle containing both references.
Parameters
- other OfficeIMO.Excel.ExcelReference
Returns
ExcelReferencepublic bool Contains(int row, int column) #Returns whether this rectangular reference contains a cell.
Parameters
- row int
- column int
Returns
boolpublic bool Equals(ExcelReference? other) #Indicates whether the current object is equal to another object of the same type.
Parameters
- other OfficeIMO.Excel.ExcelReference?
- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.public override bool Equals(object? obj) #Determines whether the specified object is equal to the current object.
Parameters
- obj object?
- The object to compare with the current object.
Returns
bool true if the specified object is equal to the current object; otherwise, false.public IReadOnlyList<ExcelReference> Except(ExcelReference other) #Subtracts an overlapping rectangle and returns up to four non-overlapping rectangles.
Parameters
- other OfficeIMO.Excel.ExcelReference
Returns
IReadOnlyList<ExcelReference>public override int GetHashCode() #Serves as the default hash function.
Returns
int A hash code for the current object.public ExcelReference? Intersect(ExcelReference other) #Returns the rectangular intersection, or null when the references do not overlap.
Parameters
- other OfficeIMO.Excel.ExcelReference
Returns
ExcelReference?public bool Intersects(ExcelReference other) #Returns whether two references on the same qualifier intersect.
Parameters
- other OfficeIMO.Excel.ExcelReference
Returns
boolpublic ExcelReference Offset(int rowOffset, int columnOffset) #Returns a translated reference and validates worksheet boundaries.
Parameters
- rowOffset int
- columnOffset int
Returns
ExcelReferencepublic static ExcelReference Parse(string text, ExcelReferenceStyle style = A1, int anchorRow = 1, int anchorColumn = 1) #Parses a reference and throws when it is invalid.
Parameters
- text string
- style OfficeIMO.Excel.ExcelReferenceStyle = A1
- anchorRow int = 1
- anchorColumn int = 1
Returns
ExcelReferencepublic string ToString(ExcelReferenceStyle style, int anchorRow = 1, int anchorColumn = 1) #Formats the reference using A1 or R1C1 notation.
Parameters
- style OfficeIMO.Excel.ExcelReferenceStyle
- anchorRow int = 1
- anchorColumn int = 1
Returns
stringpublic override string ToString() #Returns a string that represents the current object.
Returns
string A string that represents the current object.public static bool TryParse(string? text, out ExcelReference? reference, ExcelReferenceStyle style = A1, int anchorRow = 1, int anchorColumn = 1) #Tries to parse an A1 or R1C1 cell/range reference.
Parameters
- text string?
- reference OfficeIMO.Excel.ExcelReference?
- style OfficeIMO.Excel.ExcelReferenceStyle = A1
- anchorRow int = 1
- anchorColumn int = 1
Returns
boolInherited Methods
Properties
public string? Qualifier { get; } #Optional workbook/sheet qualifier without the trailing exclamation mark.
public ExcelReferencePoint End { get; } #Second authored endpoint. Equals ExcelReference.Start for a cell.
public bool IsQualified { get; } #Whether the reference has a workbook or worksheet qualifier.