XSSFWorkbook xssfworkbook = new XSSFWorkbook(fs);
ISheet sheet = xssfworkbook.GetSheet("表头");
int rowCount = 1;
if (sheet.GetRow(1) == null)
{
sheet.CreateRow(1);
}
IRow _row = sheet.GetRow(rowCount);
for (int i = 0; i <= 35; i++)
{
if (_row.GetCell(i) == null)
{
_row.CreateCell(i);
}
}
通过NPOI读取Excel模板以后,读取excel的行或者列时,出现引用错误;