Return-Path: Delivered-To: apmail-poi-user-archive@www.apache.org Received: (qmail 55403 invoked from network); 7 Mar 2010 10:41:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Mar 2010 10:41:04 -0000 Received: (qmail 76455 invoked by uid 500); 7 Mar 2010 10:40:44 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 76385 invoked by uid 500); 7 Mar 2010 10:40:44 -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 58008 invoked by uid 99); 5 Mar 2010 08:39:52 -0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Date: Fri, 5 Mar 2010 09:39:11 +0100 From: Robert Tomanek X-Priority: 3 (Normal) Message-ID: <13610103814.20100305093911@tomanek.name> To: user@poi.apache.org Subject: Suppressing cell errors like xlNumberAsText MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi, I need to write values into Excel cells. I don't have much control over these values as they come from an external source via XML (so all of them are Strings). Most of the time it works fine for me however sometimes Excel is trying to be too smart and displays the dreaded green triangles, like the one for "Number Stored as Text": "The number in this cell is formatted as a number or preceded by an apostrophe" -> "Convert to Number" / "Ignore Error". I would like to programmatically (via POI) set the Ignore property for cell errors to True. In VBA it looks like this: cell.Errors.Item(xlNumberAsText).Ignore =3D True More info: http://msdn.microsoft.com/en-us/library/bb223803.aspx http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.named= range.errors.aspx How do I go about that in POI? Being smart about cell types (e.g. trying to detect integers and write them as such) is not really an option for me -- the values from the external source can have really fancy formatting and I can never be sure what will trigger Excel's filters. Let alone the unneeded code complexity. So, is there any way to set cell error ignoring in POI? Kind regards, r. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org