Class ExcelAddressBase
- Namespace
- OfficeOpenXml
- Assembly
- EPPlus.dll
A range address
public class ExcelAddressBase : ExcelCellBase
- Inheritance
-
ExcelAddressBase
- Derived
- Inherited Members
Remarks
Examples of addresses are "A1" "B1:C2" "A:A" "1:1" "A1:E2,G3:G5"
Constructors
ExcelAddressBase(int, int, int, int)
Creates an Address object
public ExcelAddressBase(int fromRow, int fromCol, int toRow, int toColumn)
Parameters
ExcelAddressBase(int, int, int, int, bool, bool, bool, bool)
Creates an Address object
public ExcelAddressBase(int fromRow, int fromCol, int toRow, int toColumn, bool fromRowFixed, bool fromColFixed, bool toRowFixed, bool toColFixed)
Parameters
fromRowintStart row
fromColintStart column
toRowintEnd row
toColumnintEnd column
fromRowFixedboolStart row fixed
fromColFixedboolStart column fixed
toRowFixedboolEnd row fixed
toColFixedboolEnd column fixed
ExcelAddressBase(int, string, int, int, int, int)
Creates an address object
public ExcelAddressBase(int externalReferenceIx, string worksheetName, int fromRow, int fromCol, int toRow, int toColumn)
Parameters
externalReferenceIxintIndex of an external reference
worksheetNamestringWorksheet name
fromRowintStart row
fromColintStart column
toRowintEnd row
toColumnintEnd column
ExcelAddressBase(string, ExcelPackage, ExcelAddressBase)
Creates an Address object
public ExcelAddressBase(string address, ExcelPackage pck, ExcelAddressBase referenceAddress)
Parameters
addressstringThe Excel Address
pckExcelPackageReference to the package to find information about tables and names
referenceAddressExcelAddressBaseThe address
Remarks
Examples of addresses are "A1" "B1:C2" "A:A" "1:1" "A1:E2,G3:G5"
ExcelAddressBase(string, ExcelWorkbook, string)
Creates an Address object
public ExcelAddressBase(string address, ExcelWorkbook wb = null, string wsName = null)
Parameters
addressstringThe Excel Address
wbExcelWorkbookThe workbook to verify any defined names from
wsNamestringThe name of the worksheet the address referes to
Remarks
Examples of addresses are "A1" "B1:C2" "A:A" "1:1" "A1:E2,G3:G5"
ExcelAddressBase(string, int, int, int, int)
Creates an Address object
public ExcelAddressBase(string worksheetName, int fromRow, int fromCol, int toRow, int toColumn)
Parameters
worksheetNamestringWorksheet name
fromRowintStart row
fromColintStart column
toRowintEnd row
toColumnintEnd column
Properties
Address
The address for the range
public virtual string Address { get; }
Property Value
AddressAbsolute
The \(absolute\) address
public string AddressAbsolute { get; }
Property Value
Columns
Number of columns int the address
public int Columns { get; }
Property Value
End
Gets the row and column of the bottom right cell.
public ExcelCellAddress End { get; }
Property Value
- ExcelCellAddress
The end row column.
ExternalReferenceIndex
The index to the external reference. Return 0, the current workbook, if no reference exists.
public int ExternalReferenceIndex { get; }
Property Value
FullAddress
The full address including the worksheet
public string FullAddress { get; }
Property Value
IsExternal
Returns true the address contains an external reference
public bool IsExternal { get; }
Property Value
IsFullColumn
Returns true if the range spans a full column
public bool IsFullColumn { get; }
Property Value
IsFullRow
Returns true if the range spans a full row
public bool IsFullRow { get; }
Property Value
IsName
If the address is a defined name
public bool IsName { get; }
Property Value
LocalAddress
The address without the workbook or worksheet reference
public string LocalAddress { get; }
Property Value
Rows
Number of rows int the address
public int Rows { get; }
Property Value
Start
Gets the row and column of the top left cell.
public ExcelCellAddress Start { get; }
Property Value
- ExcelCellAddress
The start row column.
Table
If the address is refering a table, this property contains additional information
public ExcelTableAddress Table { get; }
Property Value
Methods
BeforeChangeAddress()
Method for actions that must be taken before address is changed
protected virtual void BeforeChangeAddress()
ChangeAddress()
Called when the address changes
protected virtual void ChangeAddress()
Equals(object)
Returns true if the item is equal to another item.
public override bool Equals(object obj)
Parameters
objobjectThe item to compare
Returns
- bool
True if the items are equal
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
SetAddress(string, ExcelWorkbook, string)
Sets the address
protected void SetAddress(string address, ExcelWorkbook wb, string wsName)
Parameters
addressstringThe address
wbExcelWorkbookwsNamestring
ToString()
Returns the address text
public override string ToString()
Returns
Validate()
Validate the address
protected void Validate()