Please use NPOI.SS.UserModel.WorkbookFactory. It will automatically determine which type of Excel files are you importing and return you the correct object(HSSFWorkbook or XSSFWorkbook). Actually, it will return you IWorkbook, which hides the details of real object.
↧