× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Everyone,

I'm using the Jakarta POI HSSF APIs to load an existing Excel workbook, add
a worksheet to it, and write it out as a new workbook. This works fine
except when the existing workbook contains deleted named ranges --
apparently when you name a range in Excel, then delete the defined name, it
hangs around in the workbook in a deleted state.  When this happens, the
program runs ok, but displays some Java messages of the form "[WARNING]
Unknown Ptg 3c (60).".  Excel can open the resulting spreadsheet, but when
you try to save it, Excel crashes (I'm using Excel 2000 version 9.0.2720).

I found the bug at http://issues.apache.org/bugzilla/show_bug.cgi?id=27272,
it's resolved, and there's a patch (see below).  However, the patch is dated
05/17/2005, and is not incorporated into any of the available bin downloads.
Is there a way I can use the patch to update my existing bin download?  I'm
no Java expert, but I'd like to learn.

My guess would be I'd have to download the source, apply the patch, and
recompile.  If there's an easier way, I'd really like to hear it.



Index: src/java/org/apache/poi/hssf/record/formula/Ptg.java
===================================================================
RCS file:
/home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/record/formula/Ptg.
java,v
retrieving revision 1.36
diff -u -r1.36 Ptg.java
--- src/java/org/apache/poi/hssf/record/formula/Ptg.java        2 Jan 2005
01:00:52 -0000  1.36
+++ src/java/org/apache/poi/hssf/record/formula/Ptg.java        15 May 2005
18:25:07 -0000
@@ -260,6 +260,20 @@
                 retval = new Ref3DPtg(data, offset);
                 break;

+            case DeletedArea3DPtg.sid :      // 0x3b     These 3 values
+             case DeletedArea3DPtg.sid+0x20 : // 0x5b     documented in
+             case DeletedArea3DPtg.sid+0x40 : // 0x7b     openOffice.org
doc.
+
+                retval = new DeletedArea3DPtg(data, offset);
+                break;
+
+            case DeletedRef3DPtg.sid:      // 0x3a     These 3 values
+             case DeletedRef3DPtg.sid+0x20: // 0x5a     documented in
+             case DeletedRef3DPtg.sid+0x40: // 0x7a     openOffice.org doc.
+
+                retval = new DeletedRef3DPtg(data, offset);
+                break;
+
             case MissingArgPtg.sid:
                 retval = new MissingArgPtg(data,offset);
                 break;


tia,
Peter Dow
Dow Software Services, Inc.
www.dowsoftware.com
909 793-9050 voice
909 793-4480 fax

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.7.4/16 - Release Date: 6/15/2005



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.