Version

Referencing Cells and Regions (Infragistics Excel Engine)

You can access a WorksheetCell object or a WorksheetRegion object by calling the Worksheet object’s GetCell or GetRegion methods, respectively. Both methods accept a string parameter that references a cell. Getting a reference to a cell is useful when applying formats or working with formulas and cell contents. A typical usage of the GetRegion method is shown in Merging Cells article (for more information refer to the Related Topics section).

The following example code demonstrates how to reference cells and regions. The example code assumes you have a reference to a Worksheet object named worksheet1.

In Visual Basic:

Imports Infragistics.Documents.Excel
...
'Accessing a single cell
Dim cellE2 As WorksheetCell = worksheet1.GetCell("E2")
'Accessing a range of cells
Dim regionG As WorksheetRegion = worksheet1.GetRegion("G1:G10")

In C#:

using Infragistics.Documents.Excel;
...
//Accessing a single cell
WorksheetCell cellE2 = worksheet1.GetCell("E2");
//Accessing a range of cells
WorksheetRegion regionG = worksheet1.GetRegion("G1:G10");