You can't refer to the underlying location values
you have to refer to the row of the range as if the range is a full spreadsheet
this is what I did
public static IRange
RemoveHeader(IRange range)
{
try
{
string
startingCol ="a";
string
endingCol = GetExcelColumnName(range.ColumnCount);
int
startRow = 2;
int
endRow = range.RowCount;
string
newrange = string.Format("{0}{1}:{2}{3}", startingCol, startRow,
endingCol, endRow);
if
(!range.Union(range.Range[newrange]).Equals(range))
{
throw
new EExcelUtilsRangeOutOfBoundsOfData();
}
return
range[newrange];
}
catch
{
throw
new EExcelUtilsRangeOutOfBoundsOfData();
}
}
No comments:
Post a Comment