Return-Path: Delivered-To: apmail-poi-dev-archive@www.apache.org Received: (qmail 75597 invoked from network); 3 Aug 2010 16:08:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Aug 2010 16:08:21 -0000 Received: (qmail 44719 invoked by uid 500); 3 Aug 2010 16:08:21 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 44673 invoked by uid 500); 3 Aug 2010 16:08:20 -0000 Mailing-List: contact dev-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Developers List" Delivered-To: mailing list dev@poi.apache.org Received: (qmail 44502 invoked by uid 99); 3 Aug 2010 16:08:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 16:08:18 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=FORGED_HOTMAIL_RCVD2,FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 16:08:13 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OgK1x-0000TE-Cv for dev@poi.apache.org; Tue, 03 Aug 2010 09:07:53 -0700 Message-ID: <29337197.post@talk.nabble.com> Date: Tue, 3 Aug 2010 09:07:53 -0700 (PDT) From: Osmosis Paul To: dev@poi.apache.org Subject: Create a XSSFWorkbook from a XSSFReder MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: politrons@hotmail.com well in general that i'm trying is get an xlsx file load with XSSF and when i have an object XSSFReader by the OPCPackage,iterate and modify, every sheet, and then create a new XSSFWorkbook, load over him the modification information, and update or create a new file. The first problem that i had has been i remark if you dont mind in code: ReadonlySharedStringsTable strings = new ReadonlySharedStringsTable(this.xlsxPackage); XSSFReader xssfReader = new XSSFReader(this.xlsxPackage); StylesTable styles = xssfReader.getStylesTable(); XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) xssfReader.getSheetsData(); int index = 0; while (iter.hasNext()) { InputStream stream = iter.next(); XSSFWorkbook wb = new XSSFWorkbook(stream); //Here have the error String sheetName = iter.getSheetName(); this.output.println(); this.output.println(sheetName + " [index=" + index + "]:"); processSheet(styles, strings, stream); ++index; stream.close(); } The error that i recieve is this: Exception in thread "main" org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file: 'C:\Users\pablo\AppData\Local\Temp\poifiles\poi-ooxml--1808017487.tmp' 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.util.PackageHelper.open(PackageHelper.java:53) at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:144) at org.apache.poi.xssf.eventusermodel.XLSX2CSV.process(XLSX2CSV.java:519) at org.apache.poi.xssf.eventusermodel.XLSX2CSV.main(XLSX2CSV.java:624) Thanks everyone for the help -- View this message in context: http://old.nabble.com/Create-a-XSSFWorkbook-from-a-XSSFReder-tp29337197p29337197.html Sent from the POI - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org For additional commands, e-mail: dev-help@poi.apache.org