private ExcelAddress ConvertToA1C1(ExcelAddress addr)
        {
            //Convert the Table-style Address to an A1C1 address
            addr.SetRCFromTable(_package, addr);
            var a = new ExcelAddress(addr._fromRow, addr._fromCol, addr._toRow, addr._toCol);

            a._ws = addr._ws;
            return(a);
        }
        public override IRangeInfo GetRange(string worksheet, int row, int column, string address)
        {
            var addr = new ExcelAddress(worksheet, address);

            if (addr.Table != null)
            {
                addr.SetRCFromTable(_package, new ExcelAddressBase(row, column, row, column));
            }
            //SetCurrentWorksheet(addr.WorkSheet);
            var wsName = string.IsNullOrEmpty(addr.WorkSheet) ? _currentWorksheet.Name : addr.WorkSheet;
            var ws     = _package.Workbook.Worksheets[wsName];

            //return new CellsStoreEnumerator<object>(ws._values, addr._fromRow, addr._fromCol, addr._toRow, addr._toCol);
            return(new RangeInfo(ws, addr._fromRow, addr._fromCol, addr._toRow, addr._toCol));
        }
Beispiel #3
0
        public override IRangeInfo GetRange(string worksheet, int row, int column, string address)
        {
            var excelAddress = new ExcelAddress(worksheet, address);

            // External references should not be resolved.
            if (!string.IsNullOrEmpty(excelAddress?.Workbook))
            {
                return(null);
            }
            if (excelAddress.IsTableAddress)
            {
                excelAddress.SetRCFromTable(_package, new ExcelAddress(row, column, row, column));
            }
            var wsName = string.IsNullOrEmpty(excelAddress.WorkSheet) ? _currentWorksheet.Name : excelAddress.WorkSheet;
            var ws     = _package.Workbook.Worksheets[wsName];

            return(new RangeInfo(ws, excelAddress));
        }
 public override IRangeInfo GetRange(string worksheet, int row, int column, string address)
 {
     var addr = new ExcelAddress(worksheet, address);
     if (addr.Table != null)
     {
         addr.SetRCFromTable(_package, new ExcelAddressBase(row, column, row, column));
     }
     //SetCurrentWorksheet(addr.WorkSheet); 
     var wsName = string.IsNullOrEmpty(addr.WorkSheet) ? _currentWorksheet.Name : addr.WorkSheet;
     var ws = _package.Workbook.Worksheets[wsName];
     //return new CellsStoreEnumerator<object>(ws._values, addr._fromRow, addr._fromCol, addr._toRow, addr._toCol);
     return new RangeInfo(ws, addr._fromRow, addr._fromCol, addr._toRow, addr._toCol);
 }