EPPLUS To Clear Contents of A Range Of Cells

Viewed 7771

I want to use EPPLUS to clear a range of cells. I tried the syntax below, but it gives me an error of

object reference not set to an instance of an object

What would be the proper way to clear the contents of cells A24:C36 with EPPLUS?

ExcelPackage package = new ExcelPackage();

ExcelWorksheet ws = package.Workbook.Worksheets["Sheet1"];

ws.Cells["A24:C36"].Clear();
1 Answers
Related