• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading .xls and .xlsx files using same set of APIs  RSS feed

 
Harish V Gupta
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there way to read .xls and .xlsx using same set of APIs? If yes, then how?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the Apache POI API has a set of classes that can read both formats. The package is named something like ... .ss. ...
 
Harish V Gupta
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the quick response Ulf I am using "org.apache.poi.xssf.usermodel.XSSFWorkbook" to read "xlsx" format and "org.apache.poi.hssf.usermodel.HSSFWorkbook" to read "xls" format. None of the APIs can be used to read both the formats. I might be missing the proper usage of the APIs to achieve the task. Could you please tell me how to do it exactly?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote: The package is named something like ... .ss. ...

*Not* ... .hssf. ... or ... .xssf. ...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!