Vote count:
0
I'm trying to remove rows using the following code:
public void RemoveRows(string rangeName, int rowIndex)
{
ISheet sheet = GetSheetByNamedRange(rangeName);
if (sheet != null)
{
IRow row = sheet.GetRow(rowIndex);
if (row != null)
{
sheet.RemoveRow(row);
int lastRowIdx = sheet.LastRowNum;
if (rowIndex >= 0 && rowIndex < lastRowIdx)
{
sheet.ShiftRows(rowIndex + 1, lastRowIdx, -1);//Exception
//here...
}
}
}
}
I'm getting the following Situation not covered: (59, 1543, -1, 34, 58). And when the exception is thrown, rowIndex = 58, lastRowIdx = 1543.
I've done extensive research to find out the source of the problem, but not luck.
Thanks for helping.
asked 33 secs ago
Aucun commentaire:
Enregistrer un commentaire