Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelReference

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Source revision
e163ccb36643 with working tree changes
Implements
IEquatable<ExcelReference>
Modifiers
sealed

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.

Accepted by parameters 7

Methods

public ExcelReference BoundingUnion(ExcelReference other) #

Returns the smallest rectangle containing both references.

Parameters

other OfficeIMO.Excel.ExcelReference required
public bool Contains(int row, int column) #

Returns whether this rectangular reference contains a cell.

Parameters

row int required
column int required

Returns

bool
Equals 2 overloads
public bool Equals(ExcelReference? other) #

Indicates whether the current object is equal to another object of the same type.

Parameters

other OfficeIMO.Excel.ExcelReference? required
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? required
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 required

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 required
public bool Intersects(ExcelReference other) #

Returns whether two references on the same qualifier intersect.

Parameters

other OfficeIMO.Excel.ExcelReference required

Returns

bool
public ExcelReference Offset(int rowOffset, int columnOffset) #

Returns a translated reference and validates worksheet boundaries.

Parameters

rowOffset int required
columnOffset int required
public 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 required
style OfficeIMO.Excel.ExcelReferenceStyle = A1 optional
anchorRow int = 1 optional
anchorColumn int = 1 optional
ToString 2 overloads
public string ToString(ExcelReferenceStyle style, int anchorRow = 1, int anchorColumn = 1) #

Formats the reference using A1 or R1C1 notation.

Parameters

style OfficeIMO.Excel.ExcelReferenceStyle required
anchorRow int = 1 optional
anchorColumn int = 1 optional

Returns

string
public 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? required
reference OfficeIMO.Excel.ExcelReference? required
style OfficeIMO.Excel.ExcelReferenceStyle = A1 optional
anchorRow int = 1 optional
anchorColumn int = 1 optional

Returns

bool

Properties

public ExcelReferenceKind Kind { get; } #

Reference shape.

public string? Qualifier { get; } #

Optional workbook/sheet qualifier without the trailing exclamation mark.

public ExcelReferencePoint Start { get; } #

First authored endpoint.

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.