When you use Java code to read the Excel file code, the following error is returned:
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: 268)
At jxl. Workbook. getworkbook (Workbook. Java: 253)
At test1.main (test1.java: 25)
Java code:
Workbook WB = NULL;
Inputstream is = new fileinputstream ("E: // b2.xlsx ");
Try {
WB = Workbook. getworkbook (is );
Sheet rs = WB. getsheet (0 );
Int colnum = 11;
For (INT I = 0; I <Rs. getrows (); I ++ ){
String [] nextline = new string [colnum];
For (Int J = 0; j <colnum; j ++ ){
Nextline [0] = Rs. getcell (J, I). getcontents (). Trim ();
}
}
} Catch (exception e ){
E. printstacktrace ();
}
Cause: no spending on reading Excel 2007 files (*. XLSX ). Excel 2003 (*. xls) is supported only ).