poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abdul shaikh <shaikh_abdulb...@yahoo.com>
Subject HSSF Problem saving Excel File with Macros using HSSFWorkbook
Date Fri, 14 Apr 2006 07:12:17 GMT
             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);
  Please let me know if anyone has the answer to this problem.

Send instant messages to your online friends http://uk.messenger.yahoo.com 
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message