why not unable to compile :
POIFSFileSystem fs = new POIFSFileSystem(in);
Workbook wb=new HSSFWorkbook(fs);
the complier tell me "wb" should be HSSFWorkbook Object.
why not unable to compile :
POIFSFileSystem fs = new POIFSFileSystem(in);
Workbook wb=new HSSFWorkbook(fs);
the complier tell me "wb" should be HSSFWorkbook Object.
It should be possible as HSSFWorkbook implements the Workbook interface and it works for me, no compiling issue. My suspicion is you might not have the correct Workbook
and HSSFWorkbook
classes. Can you check your imports?
These are the imports you should have:
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;