Your code is not quite correct, you have to create at least one sheet.

A workbook without sheets is in invalid state. You have to add a sheet
in order to open it in Excel.
This rule is true for all versions of Excel .

Yegor

On Thu, Oct 4, 2012 at 12:13 PM, Hans Maulwurf
<[email protected]> wrote:
> I don't understand it ... changing to java6 didn't solve it. I set up a new
> virtual machine Xubuntu and installed openjdk6 and netbeans from
> repository. I changed nothing, I'm only running these lines
>
>     public static void main(String[] args) throws IOException {
>
>         HSSFWorkbook wb = new HSSFWorkbook();
>         FileOutputStream fileOut = new
> FileOutputStream("/home/muench/workbook_test.xls");
>         wb.write(fileOut);
>         fileOut.close();
>     }
>
> But opening the xls under Windows with Microsoft Office it shows the same
> behaviour ... I don't know how to continue :/
>
>
> 2012/10/4 Hans Maulwurf <[email protected]>
>
>> Maybe the java6 and java7 lead to this behaviour? Under Windows I used
>> java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I will
>> try to switch to java6 and report here.
>>
>>
>> 2012/10/3 Hans Maulwurf <[email protected]>
>>
>>> No, I used the same version of poi on windows, saved the files and used
>>> it on linux again. Replacing them with fresh downloaded doesn't change the
>>> situation. When compiling/debugging/creating there is no error, only
>>> opening with Microsoft Office shows this error (about 3 times) and then the
>>> sheets are shown correctly.
>>>
>>>
>>> 2012/10/3 Nick Burch <[email protected]>
>>>
>>>> On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>>>>
>>>>> I'm using poi-3.8-20120326.jar and that's the same I used on Windows. I
>>>>> don't use a '/' in sheetnames, the same error comes when I only create a
>>>>> workbook and save it as xls, without cells or sheets, only the default
>>>>> sheets.
>>>>>
>>>>
>>>> Are you sure that there are no differences in POI versions? Could there
>>>> perhaps be an older version of POI lurking somewhere on your classpath?
>>>> (Check the FAQ for how to find them).
>>>>
>>>> I've had no ubuntu-specific POI problems that I can think of lately, and
>>>> I've been using POI on ubuntu for a very long time now!
>>>>
>>>> Nick
>>>>
>>>>
>>>> ------------------------------**------------------------------**
>>>> ---------
>>>> To unsubscribe, e-mail: 
>>>> [email protected].**org<[email protected]>
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>>
>>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to