This project has moved. For the latest updates, please go here.

ExcelRange Extensions

Column

Specification

Get the current cell column

Usage

// get worksheet
var sheet = package.Workbook.Worksheets["Sheet1"];
// get cell
var cell = sheet.GetCell(cellRow, cellColumn);
// get column
var column = cell.Column();
// or
var column = sheet.GetCell(cellRow, cellColumn).Column();

Row

Specification

Get the current cell row

Usage

// get worksheet
var sheet = package.Workbook.Worksheets["Sheet1"];
// get cell
var cell = sheet.GetCell(cellRow, cellColumn);
// get row
var row = cell.Row();
// or
var row = sheet.GetCell(cellRow, cellColumn).Row();

SetValue

Specification

Set the cell value

Return the current cell

Usage

// get worksheet
var sheet = package.Workbook.Worksheets["Sheet1"];
// get cell
var cell = sheet.GetCell(cellRow, cellColumn);
// set cell value
cell.SetValue("test");
// or
sheet.GetCell(cellRow, cellColumn).SetValue("test");

Last edited Dec 25, 2010 at 4:57 AM by akronite, version 6