如何阅读NPOI中的空单元格
我使用NPOI来读取excel文件。 如果单元格是数字,则代码是
movie.YourRating = watchListSheet.GetRow(rowNumber).GetCell(newIMDBformat["Your Rating"], MissingCellPolicy.CREATE_NULL_AS_BLANK).NumericCellValue;
但是,如果单元格为空,则会返回一个exception:
"Can not get numerical value from text cell."
在将NumericCellValue更改为StringCellValue之后,它也会返回一个exception。 我不知道应该用什么来阅读空单元格。 Excel文件由SetCellValue()写入。 谢谢。