Hello,
I found a problem when clearing a large cellrange. I want to clear all the data from a worksheet expect the header:
```
var cellRange = excelWorksheet.Cells[2, 1, excelWorksheet.Dimension.End.Row, excelWorksheet.Dimension.End.Column];
cellRange.Clear();
```
The code above works perfectly if the worksheet is smaller then 1024 rows. But if the range is larger, the .Clear() method refuses to delete cells after row 1024 until row 2900~ (the larger the dimension, the smaller the number that is skipped for deletion).
Recalling the .Clear() method does not work. The only thing I found to work is setting the range to exactly start from 1024 (not 1023, not 1025) when you call the .Clear() a second time:
```
var cellRange = excelWorksheet.Cells[1024, 1, excelWorksheet.Dimension.End.Row, excelWorksheet.Dimension.End.Column];
cellRange.Clear();
```
In the attachment is a sample to show the problem.
Thx,
Sven
I found a problem when clearing a large cellrange. I want to clear all the data from a worksheet expect the header:
```
var cellRange = excelWorksheet.Cells[2, 1, excelWorksheet.Dimension.End.Row, excelWorksheet.Dimension.End.Column];
cellRange.Clear();
```
The code above works perfectly if the worksheet is smaller then 1024 rows. But if the range is larger, the .Clear() method refuses to delete cells after row 1024 until row 2900~ (the larger the dimension, the smaller the number that is skipped for deletion).
Recalling the .Clear() method does not work. The only thing I found to work is setting the range to exactly start from 1024 (not 1023, not 1025) when you call the .Clear() a second time:
```
var cellRange = excelWorksheet.Cells[1024, 1, excelWorksheet.Dimension.End.Row, excelWorksheet.Dimension.End.Column];
cellRange.Clear();
```
In the attachment is a sample to show the problem.
Thx,
Sven