on 07-10-2007 2:35 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
Chandran,
since your problem was solved in the Web Dynpro for J forum, please mark this thread as solved also.
Hint for other readers: The Excel 2007 file Chandran attempted to read is not compatible for usage with JXL.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think u need to change the extension of the file from <b>"*.xlsx"</b> to <b>".xls"</b> as jxl.jar i think only understands the .xls format.
If the answer solves your problens...please do reward with points.
Thanks
ritu
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.