コード例 #1
0
 /// <summary>
 /// Creates a ExcelWorkSheetDimension using a string with Cell Range representation like 'A1:B5'.
 /// </summary>
 /// <param name="dimension">a string with Cell Range representation like 'A1:B5'</param>
 public ExcelWorkSheetDimension(String dimension)
 {
     String[] dimensions = dimension.Split(':');
     this.topLeft     = dimensions[0];
     this.bottomRight = dimensions[1];
     if (!ExcelCell.IsValidCellAddress(topLeft) || (!ExcelCell.IsValidCellAddress(BottomRight)))
     {
         throw new ArgumentException("No valid excel sheet dimension!");
     }
     firstRow = ExcelCell.GetRowNumber(topLeft);
     firstCol = ExcelCell.GetColumnNumber(topLeft);
     lastCol  = ExcelCell.GetColumnNumber(bottomRight);
     lastRow  = ExcelCell.GetRowNumber(bottomRight);
 }