Return-Path: Delivered-To: apmail-poi-user-archive@www.apache.org Received: (qmail 73640 invoked from network); 28 Oct 2009 11:27:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Oct 2009 11:27:03 -0000 Received: (qmail 65946 invoked by uid 500); 28 Oct 2009 11:27:03 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 65919 invoked by uid 500); 28 Oct 2009 11:27:02 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Delivered-To: moderator for user@poi.apache.org Received: (qmail 59221 invoked by uid 99); 28 Oct 2009 09:56:59 -0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=BAYES_20,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mayong801030@hotmail.com designates 65.55.90.174 as permitted sender) X-Originating-IP: [114.141.162.6] X-Originating-Email: [mayong801030@hotmail.com] Message-ID: From: "MaYong" To: "user@poi.apache.org"@athena.apache.org, "user-subscribe@poi.apache.org"@athena.apache.org, "user-digest-subscribe@poi.apache.org"@athena.apache.org, Subject: org.apache.poi.openxml4j.exceptions.InvalidOperationException Date: Wed, 28 Oct 2009 17:56:23 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0006_01CA57F7.F6798C60" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-OriginalArrivalTime: 28 Oct 2009 09:56:36.0274 (UTC) FILETIME=[EFD23120:01CA57B4] ------=_NextPart_000_0006_01CA57F7.F6798C60 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Dear All: when I used XSSF read Excel 2003 file, had a Exception.read Excel = 2007,ok. source: String excelFile =3D "newwork_workbook.xls"; // XSSFWorkbook wb=3Dnew XSSFWorkbook(); =20 XSSFWorkbook wb =3D wb =3D new XSSFWorkbook(excelFile); =20 XSSFSheet sheet =3D wb.getSheetAt(0); XSSFRow row =3D sheet.getRow(2); XSSFCell cell =3D row.getCell(3); if (cell =3D=3D null) cell =3D row.createCell(3); cell.setCellType(HSSFCell.CELL_TYPE_STRING); cell.setCellValue(new XSSFRichTextString("a test")); // Write the output to a file FileOutputStream fileOut =3D new = FileOutputStream("2007excel.xls"); wb.write(fileOut); fileOut.close(); Exction: Exception in thread "main" = org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't = open the specified file: 'newwork_workbook.xls' at org.apache.poi.openxml4j.opc.ZipPackage.(ZipPackage.java:102) at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:199) at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:178) at org.apache.poi.POIXMLDocument.openPackage(POIXMLDocument.java:62) at = org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:167) at PoiTest.readingAndRewritingWorkbooks(PoiTest.java:179) at PoiTest.main(PoiTest.java:57) ------=_NextPart_000_0006_01CA57F7.F6798C60--