You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by hartford123 <ka...@yahoo.com> on 2011/02/15 17:02:08 UTC

Excel error "Excel found unreadable content" with POI 3.7 and excel 2007


Using POI 3.7 FINAL
Office 2007.

I am using "SS" usermodel to create XSSF sheet and trying to open the file
.xlsm in Excel 2007 , getting the error "Excel found unreadable content in
xyz.xlsm, Do you want to recover the contents of the workbook? If you trust
the source of this workbook, click yes."
  When I click Yes, I get another popu up "Excel was able to open the file
by repairing or removing the unreadable content. Removed Records: Merge
Cells from /xl/worksheets/sheet1.xm"

Earlier we used POI 2.5 to create HSSF workbood and opened xls file in 2003,
then there were no problems.

Is it compatibility issue of POI 3.7 and office 2007?

I dont see any difference between before upgrde  and after upgrade excel
contents 

How do I avoid this excel error.

please help me out,
thanks,
Sujatha.
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/Excel-error-Excel-found-unreadable-content-with-POI-3-7-and-excel-2007-tp3386164p3386164.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: Excel found unreadable content in abc.xlx. Do want to recover the contents of this workbook?If you trust the sourceof the workbook click yes

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
Sorry to say this but I cannot reproduce the problem. This morning, I wrote
the following very simple piece of code to use as a test;

import java.io.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

/**
 *
 * @author Mark B
 */
public class MergeTest {
    
    public MergeTest(String filename) throws IOException {
        File file = null;
        FileOutputStream fos = null;
        Workbook workbook = null;
        Sheet sheet = null;
        Row row = null;
        Cell cell = null;
        CellRangeAddress mergedCells = null;
        try {
            if(filename.endsWith(".xlsx")) {
                workbook = new XSSFWorkbook();
            }
            else {
                workbook = new HSSFWorkbook();
            }
            sheet = workbook.createSheet("Merge Test");
            
            // Firstly, merge together cells A1 and C1
            mergedCells = new CellRangeAddress(0, 0, 0, 2);
            sheet.addMergedRegion(mergedCells);
            row = sheet.createRow(0);
            cell = row.createCell(0);
            cell.setCellValue("A1");
            
            // Now, merge together cell in a single column, cells D1 to D3
            mergedCells = new CellRangeAddress(0, 2, 3, 3);
            sheet.addMergedRegion(mergedCells);
            cell = row.createCell(3);
            cell.setCellValue("D1");
            
            // Finally, merge toghet cells in a square block, say F1 to H5
            mergedCells = new CellRangeAddress(0, 4, 5, 7);
            sheet.addMergedRegion(mergedCells);
            cell = row.createCell(5);
            cell.setCellValue("F1");
            
            // Now save the workbook away.
            file = new File(filename);
            fos = new FileOutputStream(file);
            workbook.write(fos);
        }
        finally {
            if(fos != null) {
                fos.close();
                fos = null;
            }
        }
    }
    
    public static void main(String[] args) {
        try {
            if(args.length == 1) {
                new MergeTest(args[0]);
            }
        }
        catch(Exception ex) {
            System.out.println("Caught a: " + ex.getClass().getName());
            System.out.println("Message: " + ex.getMessage());
            System.out.println("Stacktrace follows:.....");
            ex.printStackTrace(System.out);
        }
    }
}

and could not reproduce the error you reported.

Can you please create a similarly simple test case that does demonstrate the
problem and post that piece of code to the list? If you do so then we will
be able to conduct further investigations.
Yours

Mark B

PS The code was compiled against version 3.8. Which version are you using?



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Excel-error-Excel-found-unreadable-content-with-POI-3-7-and-excel-2007-tp3386164p5711025.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: Excel found unreadable content in abc.xlx. Do want to recover the contents of this workbook?If you trust the sourceof the workbook click yes

Posted by Yegor Kozlov <ye...@dinom.ru>.
Are you creating a new workbook from scratch or filling a template ?

Firstly, please try with the latest build from trunk. Links to nightly
builds are on the main poi page: http://poi.apache.org
If the problem is still there,  please try to narrow down it to a unit
test and then post the code . In any case we need more information to
help you.


Yegor

On Fri, Sep 28, 2012 at 6:44 PM, Eswar <cr...@gmail.com> wrote:
> Iam trying to write some data into Excel 2003 and 2007 ,
> in 2003 data is getting exported properly , but in 2007 it is not .
>
> A Pop comes up with error msg "Excel found unreadable content in abc.xlx. Do
> want to recover the contents of this workbook?If you trust the sourceof the
> workbook click yes".
>
> If i click on Yes , Excel opens and one error msg as "Removed Records: Merge
> cells from /xl/worksheets/sheet1.xml part"  comes up .
>
> Could  any one please me help me out in this
>
>
>
> --
> View this message in context: http://apache-poi.1045710.n5.nabble.com/Excel-error-Excel-found-unreadable-content-with-POI-3-7-and-excel-2007-tp3386164p5711023.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>

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


Excel found unreadable content in abc.xlx. Do want to recover the contents of this workbook?If you trust the sourceof the workbook click yes

Posted by Eswar <cr...@gmail.com>.
Iam trying to write some data into Excel 2003 and 2007 , 
in 2003 data is getting exported properly , but in 2007 it is not .

A Pop comes up with error msg "Excel found unreadable content in abc.xlx. Do
want to recover the contents of this workbook?If you trust the sourceof the
workbook click yes".

If i click on Yes , Excel opens and one error msg as "Removed Records: Merge
cells from /xl/worksheets/sheet1.xml part"  comes up . 

Could  any one please me help me out in this 



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Excel-error-Excel-found-unreadable-content-with-POI-3-7-and-excel-2007-tp3386164p5711023.html
Sent from the POI - User mailing list archive at Nabble.com.

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