poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avik.sengu...@itellix.com
Subject Re: More Excel Crashes
Date Mon, 06 Oct 2003 09:40:47 GMT
Hi!

In you workbook, in the first sheet (All Data), there are two named ranges
defined (Insert->Name->Define) one is PM which is defined as ='All
Data'!$T$1:$U$2. The other is PM_1 which seems to be defined to 'All Data'!#REF
. This causes the resulting xl file to become corrupt. ( Unknown Ptg 3d is the
'reference to error ' ptg, i think)

If you delete the named ranged PM_1 from test.xls, the resulting file
(output.xls) opens flawlessly in Excel. Tested in Excel 2002. 

Moral of the story: POI cannot handle named ranges that are #REF while writing
out a file. 

Hope this workaround works for you. At some point this will be fixed, if you
could add your code and excel file to bugzilla, that'll be a great help. (I dont
think we'll do this before 2.0, since there is an ok-ish workaround)

HTH

Regards
-
Avik


Quoting "Jean, Victor [IT]" <victor.jean@citigroup.com>:

> I'm using POI to do a exact copy of an excel file.
> 
> here's the code:
> 
>   HSSF             hssf   = new HSSF("c:/upload/test.xls");           
>   HSSFWorkbook     wb     = hssf.hssfworkbook;
>   FileOutputStream stream = new FileOutputStream("c:/upload/output.xls");
>   wb.write(stream);
>   stream.close();
> 
> The output file opens up fine, however when I try to save the output file
> or when I press CTRL-C on a cell.  It crashes excel throwing a Dr. Watson.
> 
> I'm getting this warning message when I run the code:
> 
> [WARNING] Unknown Ptg 3d (61)
> 
> Attached is the excel file i'm trying to copy.
> 
> 
> Thanks for your help!  Great product so far!
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Mime
View raw message