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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17475

Removal of sheets with diagrams corrupts file





------- Additional Comments From [EMAIL PROTECTED]  2003-03-03 14:37 -------
/*
The following code produces a corrupt(?) excel file by modifying the attached 
template file (using jakarta-poi-1.11.0-dev-20030225.jar).

Note: When opening the resulting "out.xls", Excel does not crash immediately, 
but behaves strangely. I cannot select the sheet, the diagram is empty. If I 
try to change the diagram's source fields, Excel crashes.
*/

import java.io.FileInputStream;
import java.io.FileOutputStream;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class SimpleExcelTest {
        public static void main(String[] args) throws Exception {
                HSSFWorkbook book = new HSSFWorkbook(new FileInputStream
("template.xls"));
                
                book.removeSheetAt(0);
        
                FileOutputStream fOut = new FileOutputStream("out.xls");
                book.write(fOut);
                fOut.close();
        }
}

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

Reply via email to