on 07-10-2007 2:37 PM
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
Hi,
The Exception rasied may be due to incompatable version.
Try to save your Excel file in the format 97-2003 and Try.
http://www.archivesat.com/JExcelApi/thread362381.htm
Satish Kumar SV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Chandran,
please ensure, that the file you're trying to open is really an Excel (e.g. binary and not a text) file. Excel is capable of opening any structured text file (separated by tab, commata...), JXL is only able to handle the "real" binary Excel format.
Try opening the file with the Notepad.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.