Hi,
I have an excel file which contains macros. I am trying to save
this excel file with some modifications like inserting some text in cells and
changing color of cells.
When I do the above on an excel file without macros it does it
correctly but when I try with one containing macros the resultant file gives
the error
Source Excel File: DataBook.xls contains macros. Opens properly.
Destination Excel File: DataBook.xls. Does not open correctly.
Error: "Unable to read file"
I am using org.apache.poi.hssf.usermodel.HSSFWorkbook code shown below.
HSSFWorkbook wb=null;
POIFSFileSystem fs=null;
FileOutputStream dataFileOut = null;
fs = new POIFSFileSystem(new FileInputStream( importDirectory+ "\\" +
DataBook.xls));
wb= new HSSFWorkbook(fs);
dataFileOut= new FileOutputStream(importDirectory+"\\" + DataBook.xls);
wb.write(dataFileOut);
dataFileOut.flush();
dataFileOut.close();
Please let me know if anyone has the answer to this problem.
Regards,
Abdul
Send instant messages to your online friends http://uk.messenger.yahoo.com