Return-Path: Delivered-To: apmail-jakarta-poi-user-archive@www.apache.org Received: (qmail 88457 invoked from network); 7 Jul 2006 20:22:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jul 2006 20:22:14 -0000 Received: (qmail 70678 invoked by uid 500); 7 Jul 2006 20:22:14 -0000 Delivered-To: apmail-jakarta-poi-user-archive@jakarta.apache.org Received: (qmail 70116 invoked by uid 500); 7 Jul 2006 20:22:12 -0000 Mailing-List: contact poi-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "POI Users List" Reply-To: "POI Users List" Delivered-To: mailing list poi-user@jakarta.apache.org Received: (qmail 70103 invoked by uid 99); 7 Jul 2006 20:22:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jul 2006 13:22:12 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=HTML_MESSAGE,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [64.18.1.185] (HELO exprod6og52.obsmtp.com) (64.18.1.185) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jul 2006 13:22:01 -0700 Received: from source ([157.191.3.40]) (using TLSv1) by exprod6ob52.postini.com ([64.18.5.12]) with SMTP; Fri, 07 Jul 2006 13:21:06 PDT Received: from na-gateways02.notes.mckinsey.com (na-gateways02.mckinsey.com [157.191.168.25]) by am-util-mx01.mckinsey.com (MOS 3.7.4a-GA) with ESMTP id ATM46890; Fri, 7 Jul 2006 16:21:05 -0400 (EDT) In-Reply-To: <586ED719740E6447A10DE62BA05D737402B3E58F@mail01.lan.onvoy.com> To: "POI Users List" Subject: Re: problem evaluating reference to another sheet MIME-Version: 1.0 X-Mailer: Lotus Notes 653HF719 September 12, 2005 Message-ID: From: Sumit_Machwe@external.mckinsey.com Date: Fri, 7 Jul 2006 16:21:04 -0400 X-MIMETrack: Serialize by Router on NA-Gateways02/NorthAmerica/MCKINSEY(Release 6.5.4FP2 HF52|November 11, 2005) at 07/07/2006 04:21:05 PM, Serialize complete at 07/07/2006 04:21:05 PM Content-Type: multipart/alternative; boundary="=_alternative 006FCABE852571A4_=" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --=_alternative 006FCABE852571A4_= Content-Type: text/plain; charset="US-ASCII" Jeff, Cell references to other worksheets within the worksheet should work. When I implemented this, I found that "spaces" within the sheet name are not recognized by POI. If sheet names are like "firstname lastname" then it will create problems. Try removing the space chars in the names and then give it a shot. I did this while "creating" multi-tab excel workbook having cross reference formula's. hope this helps. Sumit "Jeff Kays" 07/07/2006 03:38 PM Please respond to "POI Users List" To cc Subject problem evaluating reference to another sheet Hi. I'm trying to read an Excel spreadsheet that has references to other sheets in the same workbook. References to cells on my current sheet work fine, but when I try to evaluate one of these references to another sheet I get the following exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:444) at org.apache.poi.hssf.util.CellReference.(CellReference.java:44) at org.apache.poi.hssf.record.formula.ReferencePtg.(ReferencePtg.java:50) at org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:292) at org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:480) at org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:569) at org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:617) at org.apache.poi.hssf.model.FormulaParser.parse(FormulaParser.java:721) at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.internalEvaluate(HSSFFormulaEvaluator.java:284) at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluate(HSSFFormulaEvaluator.java:181) I'm using the 3.0 alpha1 jars. My questions are: Should this work? If not, can I do something like create an HSSFFormulaEvaluator for the sheet being referenced and then evaluate the cell on the reference sheet with that evaluator? Any help is greatly appreciated! jeff --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ +=========================================================+ This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. +=========================================================+ --=_alternative 006FCABE852571A4_=--