You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Davis Varkey Koottala <da...@sg.systemaccess.com> on 2007/03/15 12:07:15 UTC

Unable to open created excel file

Hi All,

I am unable to open the excel file which is created programatically.  This 
is what I am doing :

fileIn = new FileInputStream("test.xls");
POIFSFileSystem fs = new POIFSFileSystem(fileIn);
 
HSSFWorkbook test = new HSSFWorkbook(fs);
test.removeSheetAt(2);

 fileOut = new FileOutputStream("D:\\Workshop\\poi\\excel 
Utility\\workbookout.xls");
 test.write(fileOut);

After writing the file, when I open it, it just open the file poping up 
the microsoft standard error dialog.

Your help is much appreciated.

Regards,
Davis

Re: Unable to open created excel file

Posted by Simone Caldon <ec...@yahoo.it>.
Yes Davis, I had the same problems with my complicated excels...
I've made many attempts, even  just open the file and write it without 
modifying anything...POI produces a file a little bit larger and  
corrupt for MS Excel...But with open office the content was valid and it 
opens normally... I think that the problem is the large number of 
complicated formulas in the sheet, if I delete some of them the file 
works correctly.
But I also think that excel writes an history in some part of file, of 
any edit operations. I was able to have 2 excel file with the same 
number of cell, the same number of formulas with the same values, after 
the POI processing one works correctly, the other was wrong... With a 
binary comparator I checked the two files and even if they had the same 
Excel contents, they were different...
FYI I've also tried open office UNO classes to read excel but It's a 
more complicated system...
So I switched to VB Script to reproduce the excel file :(

Any informations of the standar Open Document format????
Regards
Davis Varkey Koottala wrote:
> Hi All,
>
> Thanks for your attempt to help me.
>
> David, I have tried with POI3 RC1, it gives the same problem. I have 
> attached the generated excel, I agree that, its veri complicated excel 
> cross referencing between sheets. Don't know if that is the cause.
>
> Marian, the sheet does exist.
>
> Any of your further is greatly appreciated..
>
> Regards,
> Davis
>
>
>
>
>
> David Fisher <df...@jmlafferty.com> 
> 03/15/2007 08:32 PM
> Please respond to
> "POI Users List" <po...@jakarta.apache.org>
>
>
> To
> "POI Users List" <po...@jakarta.apache.org>
> cc
>
> Subject
> Re: Unable to open created excel file
>
>
>
>
>
>
> Try POI3 RC1.
>
> On Mar 15, 2007, at 7:10 AM, Simone Caldon wrote:
>
>   
>> Oh no Marian, in case of complicated excel file POI outputs 
>> corrupted files, there's some bug reported in bugzilla...
>> Marian Roman wrote:
>>     
>>> Hi Davies,
>>>
>>> I see no errors in Your code, I tried it, there can be a problem 
>>> only if You
>>> want to remove a non-existing sheet, You get
>>> java.lang.IndexOutOfBoundsException.
>>>
>>> Marian
>>>
>>> On 3/15/07, Davis Varkey Koottala <da...@sg.systemaccess.com> wrote:
>>>       
>>>> Hi All,
>>>>
>>>> I am unable to open the excel file which is created 
>>>> programatically.  This
>>>> is what I am doing :
>>>>
>>>> fileIn = new FileInputStream("test.xls");
>>>> POIFSFileSystem fs = new POIFSFileSystem(fileIn);
>>>>
>>>> HSSFWorkbook test = new HSSFWorkbook(fs);
>>>> test.removeSheetAt(2);
>>>>
>>>> fileOut = new FileOutputStream("D:\\Workshop\\poi\\excel
>>>> Utility\\workbookout.xls");
>>>> test.write(fileOut);
>>>>
>>>> After writing the file, when I open it, it just open the file 
>>>> poping up
>>>> the microsoft standard error dialog.
>>>>
>>>> Your help is much appreciated.
>>>>
>>>> Regards,
>>>> Davis
>>>>
>>>>         
>> ---------------------------------------------------------------------
>> 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/
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> 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/
>
>
>
>   

Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 

---------------------------------------------------------------------
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/


Re: Unable to open created excel file

Posted by Davis Varkey Koottala <da...@sg.systemaccess.com>.
Hi All,

Thanks for your attempt to help me.

David, I have tried with POI3 RC1, it gives the same problem. I have 
attached the generated excel, I agree that, its veri complicated excel 
cross referencing between sheets. Don't know if that is the cause.

Marian, the sheet does exist.

Any of your further is greatly appreciated..

Regards,
Davis





David Fisher <df...@jmlafferty.com> 
03/15/2007 08:32 PM
Please respond to
"POI Users List" <po...@jakarta.apache.org>


To
"POI Users List" <po...@jakarta.apache.org>
cc

Subject
Re: Unable to open created excel file






Try POI3 RC1.

On Mar 15, 2007, at 7:10 AM, Simone Caldon wrote:

> Oh no Marian, in case of complicated excel file POI outputs 
> corrupted files, there's some bug reported in bugzilla...
> Marian Roman wrote:
>> Hi Davies,
>>
>> I see no errors in Your code, I tried it, there can be a problem 
>> only if You
>> want to remove a non-existing sheet, You get
>> java.lang.IndexOutOfBoundsException.
>>
>> Marian
>>
>> On 3/15/07, Davis Varkey Koottala <da...@sg.systemaccess.com> wrote:
>>>
>>> Hi All,
>>>
>>> I am unable to open the excel file which is created 
>>> programatically.  This
>>> is what I am doing :
>>>
>>> fileIn = new FileInputStream("test.xls");
>>> POIFSFileSystem fs = new POIFSFileSystem(fileIn);
>>>
>>> HSSFWorkbook test = new HSSFWorkbook(fs);
>>> test.removeSheetAt(2);
>>>
>>> fileOut = new FileOutputStream("D:\\Workshop\\poi\\excel
>>> Utility\\workbookout.xls");
>>> test.write(fileOut);
>>>
>>> After writing the file, when I open it, it just open the file 
>>> poping up
>>> the microsoft standard error dialog.
>>>
>>> Your help is much appreciated.
>>>
>>> Regards,
>>> Davis
>>>
>>
>
>
> ---------------------------------------------------------------------
> 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/
>
>


---------------------------------------------------------------------
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/



Re: Unable to open created excel file

Posted by David Fisher <df...@jmlafferty.com>.
Try POI3 RC1.

On Mar 15, 2007, at 7:10 AM, Simone Caldon wrote:

> Oh no Marian, in case of complicated excel file POI outputs  
> corrupted files, there's some bug reported in bugzilla...
> Marian Roman wrote:
>> Hi Davies,
>>
>> I see no errors in Your code, I tried it, there can be a problem  
>> only if You
>> want to remove a non-existing sheet, You get
>> java.lang.IndexOutOfBoundsException.
>>
>> Marian
>>
>> On 3/15/07, Davis Varkey Koottala <da...@sg.systemaccess.com> wrote:
>>>
>>> Hi All,
>>>
>>> I am unable to open the excel file which is created  
>>> programatically.  This
>>> is what I am doing :
>>>
>>> fileIn = new FileInputStream("test.xls");
>>> POIFSFileSystem fs = new POIFSFileSystem(fileIn);
>>>
>>> HSSFWorkbook test = new HSSFWorkbook(fs);
>>> test.removeSheetAt(2);
>>>
>>> fileOut = new FileOutputStream("D:\\Workshop\\poi\\excel
>>> Utility\\workbookout.xls");
>>> test.write(fileOut);
>>>
>>> After writing the file, when I open it, it just open the file  
>>> poping up
>>> the microsoft standard error dialog.
>>>
>>> Your help is much appreciated.
>>>
>>> Regards,
>>> Davis
>>>
>>
>
>
> ---------------------------------------------------------------------
> 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/
>
>


---------------------------------------------------------------------
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/


Re: Unable to open created excel file

Posted by Simone Caldon <ec...@yahoo.it>.
Oh no Marian, in case of complicated excel file POI outputs corrupted 
files, there's some bug reported in bugzilla...
Marian Roman wrote:
> Hi Davies,
>
> I see no errors in Your code, I tried it, there can be a problem only 
> if You
> want to remove a non-existing sheet, You get
> java.lang.IndexOutOfBoundsException.
>
> Marian
>
> On 3/15/07, Davis Varkey Koottala <da...@sg.systemaccess.com> wrote:
>>
>> Hi All,
>>
>> I am unable to open the excel file which is created programatically.  
>> This
>> is what I am doing :
>>
>> fileIn = new FileInputStream("test.xls");
>> POIFSFileSystem fs = new POIFSFileSystem(fileIn);
>>
>> HSSFWorkbook test = new HSSFWorkbook(fs);
>> test.removeSheetAt(2);
>>
>> fileOut = new FileOutputStream("D:\\Workshop\\poi\\excel
>> Utility\\workbookout.xls");
>> test.write(fileOut);
>>
>> After writing the file, when I open it, it just open the file poping up
>> the microsoft standard error dialog.
>>
>> Your help is much appreciated.
>>
>> Regards,
>> Davis
>>
>


---------------------------------------------------------------------
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/


Re: Unable to open created excel file

Posted by Marian Roman <ro...@gmail.com>.
Hi Davies,

I see no errors in Your code, I tried it, there can be a problem only if You
want to remove a non-existing sheet, You get
java.lang.IndexOutOfBoundsException.

Marian

On 3/15/07, Davis Varkey Koottala <da...@sg.systemaccess.com> wrote:
>
> Hi All,
>
> I am unable to open the excel file which is created programatically.  This
> is what I am doing :
>
> fileIn = new FileInputStream("test.xls");
> POIFSFileSystem fs = new POIFSFileSystem(fileIn);
>
> HSSFWorkbook test = new HSSFWorkbook(fs);
> test.removeSheetAt(2);
>
> fileOut = new FileOutputStream("D:\\Workshop\\poi\\excel
> Utility\\workbookout.xls");
> test.write(fileOut);
>
> After writing the file, when I open it, it just open the file poping up
> the microsoft standard error dialog.
>
> Your help is much appreciated.
>
> Regards,
> Davis
>