I am not able to read an xlsm file using the POI Framework (HSSF). I am getting the following error while reading an xlsm file.
The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
I tried reading the file through XSSF also. Even that doesn't solve the problem. Can anyone tell me how to read a xlsm file in java code using the poi framework and write a new sheet to that file.
Best Answer
First download these JARs and add them in build path:
Now you can try this code. It will read XLSX and XLSM files: