On Jul 8, 2010, at 1:58 PM, Dan Clapp wrote:

> I tried adding a catch:
> 
> try {
>               wb1 = WorkbookFactory.create(inp);
>           }
>           catch(IOException e)

Catch "Exception"


>           {
>               System.out.println("Unable to Create Workbook" + 
> e.getMessage());
>           }
> 
> but still enters WorkbookFactory and kills the program.
> 
> I have poi-ooxml-3.6-20091214.jar, poi-3.6-20091214.jar as part of the 
> project.
> 
> I am working out of NetBeans 6.9.
> 
> Any other suggestions?
> Thanks!
> 
> David Fisher wrote:
>> You will want to use try / catch and print the exception.
>> 
>> http://www.exampledepot.com/egs/Java%20Language/TryCatch.html
>> 
>> I suspect that you are missing the ooxml jar and other dependencies.
>> 
>> http://poi.apache.org/overview.html#components
>> 
>> Regards,
>> Dave
>> 
>> On Jul 8, 2010, at 11:55 AM, Dan C wrote:
>> 
>>  
>>> Hello, I am trying to use the general xls/xlsx reader.
>>> I have too files: one save in xls format, and one saved in xlsx.
>>> They are identical files.
>>> 
>>> The xls file works just fine.  But the reading the xlsx file cause the 
>>> program
>>> to exit during the call to WorkbookFactory.create.  It enters the routine 
>>> and
>>> then the debugger says the "User Program Finished".
>>> 
>>> Here is my code:
>>> 
>>>  FileInputStream inp = null;
>>> 
>>>  inp = new FileInputStream("c:/temp/temp.xlsx");
>>>  Workbook wb1=null;
>>>  wb1 = WorkbookFactory.create(inp);
>>>  Sheet sheet1 = null;
>>>  sheet1 = wb1.getSheet("NB Model");
>>>  Sheet sheet2 = null;
>>>  sheet2 = wb1.getSheet("BB Model");
>>> 
>>> the same code works with a temp.xls file...
>>> 
>>> Any suggestions?
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
>>> For additional commands, e-mail: user-h...@poi.apache.org
>>> 
>>>    
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
>> For additional commands, e-mail: user-h...@poi.apache.org
>> 
>> 
>>  
> 
> -- 
> Ipswich Engineering Group
> 2 Lakemans Lane
> Ipswich, MA 01938
> 
> 508-517-4058
> 
> ipswic...@gmail.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org

Reply via email to