我正在使用OfficeOpenXml;用于读取excel文件及其工作正常与其他读取文件,但对于一个特定的文件我有上面提到的错误。
public ReadExcelFile(Stream stream, string worksheet, List<ExcelColumnMapping> columnMapping, ITypeConvert typeConvert = null, int headerSize = 1)
{
_stream = stream;
_excelPackage = new ExcelPackage(stream);
_worksheet = _excelPackage.Workbook.Worksheets[worksheet];
_headerSize = headerSize;
_rowCount = headerSize + 1;
var mapping = ColumnMappingRowNumber(columnMapping);
_resultColumnNumbersAndTypes = mapping.Select(x => Tuple.Create(x.Item2, x.Item3, x.Item4)).ToList();
_converter = typeConvert ?? new ExcelTypeConvert();
ReadLineValues();
}