Version

GetRegion(String,CellReferenceMode) Method

Gets the region at the specified address or name.
Syntax
'Declaration
 
Public Overloads Function GetRegion( _
   ByVal address As String, _
   ByVal cellReferenceMode As CellReferenceMode _
) As WorksheetRegion

Parameters

address
The address or name of the region.
cellReferenceMode
The cell reference mode to use to parse the region address.

Return Value

A region represented by the specified address or name.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionaddress is null.
System.ComponentModel.InvalidEnumArgumentExceptioncellReferenceMode is not defined in the CellReferenceMode enumeration.
System.ArgumentExceptionaddress is not a valid name or a valid cell or region address in the specified cell reference mode.
System.InvalidOperationExceptionaddress is a relative R1C1 address. The overload taking an origin cell must be used to resolve relative R1C1 references.
Remarks

If a cell reference is specified instead of a region reference, a 1x1 region containing the cell at the address will be returned.

If a list of references is specified, the region specified by the first reference will be returned.

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