Jexcelapi
[See all forum posts about Jexcelapi]
AssertionFailed on Workbook.getSheet()
Author: besharam05 Date: May 23, 2008 at 20:30
I'm running into a sort of oddity...
I have a File object representing an .xls workbook. I instantiate a Workbook object from the File object. The workbook has a single spreadsheet. When I try to instantiate a Sheet instance using the Workbook.getSheet() method, my application crashes with "common.AssertionFailed".
Here's my code:
/* Start code */
File file = new File( "workbook.xls" );
Workbook workbook = Workbook.getWorkbook( file );
Sheet sheet = workbook.getSheet( 0 );
/* End code */
The funny thing is, I have an Excel file that does not cause this problem. The other four I've tried cause a crash. A "fresh" .xls file (three sheets, no data in any cells) does not cause a crash, which leads me to believe something about the data in my .xls files is causing the problem. Any ideas?
Thanks
I have a File object representing an .xls workbook. I instantiate a Workbook object from the File object. The workbook has a single spreadsheet. When I try to instantiate a Sheet instance using the Workbook.getSheet() method, my application crashes with "common.AssertionFailed".
Here's my code:
/* Start code */
File file = new File( "workbook.xls" );
Workbook workbook = Workbook.getWorkbook( file );
Sheet sheet = workbook.getSheet( 0 );
/* End code */
The funny thing is, I have an Excel file that does not cause this problem. The other four I've tried cause a crash. A "fresh" .xls file (three sheets, no data in any cells) does not cause a crash, which leads me to believe something about the data in my .xls files is causing the problem. Any ideas?
Thanks
Author: besharam05 Date: May 23, 2008 at 20:30
[Write Review]