Skip to Content
2
Former Member
Jul 10, 2007 at 01:37 PM

Regarding The Copying of Data from Excel to Java

18 Views

Hi

I am attempting to copy the data from an excel file and here is the code for that and it is throwing an following exception. Plz kindly help me to solve this issue.

<u><b>Code</b></u>

import java.lang.*;

import java.io.BufferedInputStream;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.InputStream;

import java.io.OutputStream;

import java.util.Date;

import jxl.*;

public class ProjectExcel

{

public static void main(String[] args)

{

try

{

Workbook workbook = Workbook.getWorkbook(new File("c:
temp
salary.xlsx"));

Sheet sheet = workbook.getSheet(0);

Cell a1 = sheet.getCell(1,1);

String s1 = a1.getContents();

System.out.println("The Cell Content in (1,1) = "+s1);

}

catch(Exception E)

{

System.out.println(E.toString());

}

}

}

<u><b>Exception Throwned</b></u>

jxl.read.biff.BiffException: Unable to recognize OLE stream

Plz Help me to solve this issue

Thanks in Advance

Regards

Chandran S