Click or drag to resize
SheetOpenCellByDefinedName Method
Opens the cell with the specified name defined in Excel and returns a Cell object.

Namespace: Aceoffix.ExcelReader
Assembly: Aceoffix (in Aceoffix.dll) Version: 5.0.0.1
Syntax
public Cell OpenCellByDefinedName(
	string DefinedName
)

Parameters

DefinedName
Type: SystemString
The name defined in Excel can be a global name or a local name. This method will only be valid when the Cell has a DefinedName.

Return Value

Type: Cell
Return a Cell object.
Examples
The following code example shows how to use the OpenCellByDefinedName method to get the value of the specified cell.
Aceoffix.ExcelReader.Workbook wb = new Aceoffix.ExcelReader.Workbook();
Aceoffix.ExcelReader.Sheet sheet1 = wb.OpenSheet("sheet1");

string strCompanyName = sheet1.OpenCellByDefinedName("CompanyName").Value;
string strProductName = sheet1.OpenCellByDefinedName("ProductName").Value;
string strProductCode = sheet1.OpenCellByDefinedName("ProductCode").Value;
//After you get the value, you can save them to the database.

wb.Close();
See Also