private void initializeCell(int row, int column) { _currentRow = _workSheet.GetRow(row); _currentCell = new ExcelCell(_workBook, _workSheet, row, column); }
/// <summary> /// Gets a cell's value /// </summary> /// <param name="cellName">Excel cell name (A1, B32, etc)</param> /// <returns>String representation of the cell's value</returns> public string GetCellValue(string cellName) { ExcelCell cell = new ExcelCell(_workBook, _workSheet, cellName); if (!cell.IsValidCell) throw new Exception("Error - referenced cell name is not a valid cell"); return this.GetCellValue(cell.Row, cell.Column); }
/// <summary> /// Writes a value to a cell - based on the Excel cell name (A1, AZ23, etc) /// </summary> /// <param name="excelCellName">Excel cell name</param> /// <param name="value">Value to write</param> public void WriteCellValue(string excelCellName, string value) { try { ExcelCell cell = new ExcelCell(_workBook, _workSheet, excelCellName); _currentCell = cell; _currentCell.WriteCellValue(value); } catch { } }