Version

GetCell(String,WorksheetCell) Method

Gets the cell at the specified address or name.
Syntax
'Declaration
 
Public Overloads Function GetCell( _
   ByVal address As String, _
   ByVal originCell As WorksheetCell _
) As WorksheetCell
public WorksheetCell GetCell( 
   string address,
   WorksheetCell originCell
)

Parameters

address
The address or name of the cell.
originCell
The origin for resolving relative R1C1 references.

Return Value

A cell represented by the specified address or name.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionaddress is null.
System.ArgumentExceptionaddress is not a valid name or a valid cell or region address in the workbook's cell reference mode.
System.InvalidOperationExceptionaddress is a relative R1C1 address and originCell is null. An origin cell must be specified to resolve relative R1C1 references.
Remarks

The CellReferenceMode of the workbook will be used to parse the cell address.

If one or more region references are specified instead of a cell reference, the top-left cell of the first region will be returned.

The origin cell specified will not be used if a name is specified, if the workbook has an A1 cell reference mode, or if an absolute R1C1 address is specified.

If a name is specified, it must refer to a cell or region in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also