By V I J E S H


2011-03-31 09:23:55 8 Comments

I was trying to connect my Java program with an Excel file. I have did upto this. But it throws this excepion

Unable to recognize OLE stream

Please, help me to complete this.

import jxl.*;
import java.io.*;

public class excel
{
      public static void main(String[] args)throws Exception
      {

       File ex=new File("D:/worksps/test.xlsx");
       Workbook w= Workbook.getWorkbook(ex);
       Sheet s= w.getSheet(0);
       for(int i=0;i<s.getColumns();i++)
       {
         for(int j=0;j<s.getRows();j++)
         {
               Cell cell=s.getCell(i, j);
               System.out.println("     "+cell.getContents());
         }
         System.out.println("\n");
       }
      }
}

1 comments

@Pushkar 2011-03-31 09:43:31

JXL supports Excel worksheets created in Excecl 95/97 and 2000 -

Read the below in the official JXL site - http://www.andykhan.com/jexcelapi/

Features

Reads data from Excel 95, 97, 2000 workbooks Reads and writes formulas (Excel 97 and later only) Generates spreadsheets in Excel 2000 format

Your excel sheet seems to be created after Excel 2000. That seems to be the problem.

If you want to read Excel files created after Excel 2000 then you should use Apache POI. It is also an easy to use API and supports MS Excel 97 to MS Excel 2008.

@V I J E S H 2011-03-31 09:55:36

Thank you. I was using Excel 2003.

@Piyush Mattoo 2012-07-23 00:23:03

@Apache Fan: Does Jexcel API support Excel 97-2003 Worksheet?

@Pushkar 2012-07-26 09:24:22

@Piyush - No. According to documentation it only supports upto Excel 2000

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] Clone a Singleton object

0 Answered Questions

JXLS template transformation not working properly

  • 2019-03-02 06:49:36
  • Rocky
  • 88 View
  • 0 Score
  • 0 Answer
  • Tags:   java excel jxls

3 Answered Questions

[SOLVED] java exception - why does it catch?

  • 2018-12-18 20:27:00
  • Marius Donici
  • 153 View
  • 0 Score
  • 3 Answer
  • Tags:   java exception

0 Answered Questions

java parse old excel version file use poi and jxl parse all failed

6 Answered Questions

[SOLVED] Java - Method executed prior to Default Constructor

  • 2015-09-21 06:27:44
  • Rohit Nigam
  • 5032 View
  • 30 Score
  • 6 Answer
  • Tags:   java constructor

1 Answered Questions

1 Answered Questions

0 Answered Questions

JXL Api Throwing an error while reading MS Excel 2013 generated Excel File

  • 2014-07-23 09:49:03
  • Shirishkumar Bari
  • 822 View
  • 0 Score
  • 0 Answer
  • Tags:   java excel jxl

2 Answered Questions

[SOLVED] Doubt in jxl API?

  • 2009-11-09 10:55:13
  • Hariharbalaji
  • 527 View
  • 2 Score
  • 2 Answer
  • Tags:   java jxl

1 Answered Questions

How can I make OS X recognize drive letters?

Sponsored Content