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]" <[EMAIL PROTECTED]>:
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]