DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28203>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28203

Unable to open read-write excel file including forms

           Summary: Unable to open read-write excel file including forms
           Product: POI
           Version: 2.0FINAL
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HSSF
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


After I execute the following code on the attached Excel file, openning the 
excel file is impossible : Excel 97 display an error message "unable to read 
file". Excel file is just a new document including a forms component such as a 
textbox.

POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream("workbook.xls"));  
                
HSSFWorkbook wb = new HSSFWorkbook(fs, true);
                
HSSFSheet sheet = wb.getSheetAt(0);
HSSFRow row = sheet.getRow(1);
if (row == null)
        row = sheet.createRow(1);
HSSFCell cell = row.getCell((short)1);
if (cell == null)
        cell = row.createCell((short)1);
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
cell.setCellValue("a test");                    

FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();

(I'm using POI 2.5 FINAL)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to