www.webdeveloper.com
Results 1 to 11 of 11

Thread: getWorkbook Error: Unable to recognize OLE stream

  1. #1
    Join Date
    Feb 2008
    Posts
    11

    getWorkbook Error: Unable to recognize OLE stream

    Hi All,

    I have the following program,
    Code:
    package readexcel;
    import java.io.File;
     
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import jxl.*;
     
     
    public class correctCofExpDate {
        private int readFileXLS(String inFile)
        {
            String encoding = null;
            Workbook workbook = null;
            int count = 0; 
            try {
                File xlsfile = new File(inFile);
                System.out.println("new InFile works.");
                workbook = Workbook.getWorkbook(xlsfile);
            } catch (Exception e) {
                System.out.println("getWorkbook Error: " + e.getMessage());
            }
            try {
                 Sheet sheet = workbook.getSheet(0);
                 Cell[] row = null;
                 for (int i = 1; i < sheet.getRows(); i++) {
                    row = sheet.getRow(i);   
                    count += updateData(row);
                  }
                  conn.commit();
            } catch (Exception e) {
                    System.out.println("getSheet Error: " + e.getMessage());
            }                
            return count;
       }
    }
    It complies without any error but at run time it shows the following message

    new InFile works.
    getWorkbook Error: Unable to recognize OLE stream

    I have spent hours googling and found out that I am not the only one who have this problem and so far, I couldn't see any solution available. Anybody knows how I can fix it? Thanks.

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    Can you get the stack trace on this line?

    Code:
    System.out.println("getWorkbook Error: " + e.getMessage());
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  3. #3
    Join Date
    Feb 2008
    Posts
    11
    here is the stack trace:[Ljava.lang.StackTraceElement;@90cb03

    Thanks again...

  4. #4
    Join Date
    Feb 2008
    Posts
    11
    Sorry, here is the stack trace:

    getWorkbook Error: Unable to recognize OLE stream
    jxl.read.biff.BiffException: Unable to recognize OLE stream
    at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:99)
    at jxl.read.biff.File.<init>(File.java:113)
    at jxl.Workbook.getWorkbook(Workbook.java:196)
    at jxl.Workbook.getWorkbook(Workbook.java:173)
    at readexcel.correctCofExpDate.readFileXLS(correctCofExpDate.java:66)
    at readexcel.correctCofExpDate.main(correctCofExpDate.java:149)

  5. #5
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    What version of Excel was this file written in?
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  6. #6
    Join Date
    May 2009
    Posts
    1

    Exclamation

    I'm using the jxl.jar for my excel file.
    Some of experiences in this issue is that if used the older excel file version 2003, such as 2000 or 2002, it would be gotten the message "Unable to recognize OLE stream".

    Just a quick cmt ! More any conservation about this one ?

  7. #7
    Join Date
    Jun 2009
    Posts
    1

    Mahavat

    We uploaded .rem file to mahavat site, but it is not uploaded due to following error

    unable to recognize OLE Stream.

  8. #8
    Join Date
    Aug 2010
    Posts
    1
    we uploade our sales tax e return file to mahavat side but ole stream messeege shown

  9. #9
    Join Date
    Mar 2010
    Location
    Singapore
    Posts
    367
    Quote Originally Posted by TeresaLee View Post
    Hi All,

    I have spent hours googling and found out that I am not the only one who have this problem and so far, I couldn't see any solution available. Anybody knows how I can fix it? Thanks.
    Are you using JExcelApi from sourceforge ? Why not try Apache POI ? I feel Apache POI is more stable and have more support. Maybe changing to another Excel API will solve your Excel problem already ?

  10. #10
    Join Date
    Nov 2010
    Posts
    2
    Are you using JExcelApi from sourceforge ? Why not try Apache POI ? I feel Apache POI is more stable and have more support. Maybe changing to another Excel API will solve your Excel problem already ?
    Hi, I'm new in Forum and JAVA...
    I'm working with processing.core package;
    I'm research about jexcelAPI for create a specific lib for Processing;
    I get same error, but i checked that:

    1) with XLS file created with OpenOffice (in linux) works fine (until now...)
    2) with XLS file created with Excel (in mac) not works and receive the error:
    Code:
    jxl.read.biff.BiffException: Unable to recognize OLE stream
    	at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:116)
    	at jxl.read.biff.File.<init>(File.java:127)
    	at jxl.Workbook.getWorkbook(Workbook.java:221)
    	at jxl.Workbook.getWorkbook(Workbook.java:198)
    	at gml.xlsP5.WorkbookP5.<init>(WorkbookP5.java:28)
    	at gml.xlsP5.XlsP5.<init>(XlsP5.java:46)
    	at repartituraP5.RePartituraP5.setup(RePartituraP5.java:33)
    	at processing.core.PApplet.handleDraw(PApplet.java:1403)
    	at processing.core.PApplet.run(PApplet.java:1328)
    	at java.lang.Thread.run(Thread.java:680)

  11. #11
    Join Date
    Nov 2010
    Posts
    2
    Sorry,
    I forgot "thanks"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles