You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Sara Uppalapati <su...@us.ibm.com> on 2007/04/24 19:23:19 UTC

Please help - unknown grbit '16'

Hi,  We are using POI_3.0_Alpha.jar file and trying to read spread sheet 
in the code.  It was working fine until few days back.  Spread sheet was 
updated with more tabs and more data and after that getting below errors. 
I spent long time and still no clue.  Spread sheet was updated on windows 
machine with office 2003.  Please help.

Exceptions:
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at 
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:213)
        at 
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:149)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:183)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:230)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:211)
        at ReadInvSheet.main(ReadInvSheet.java:47)
Caused by: org.apache.poi.hssf.record.RecordFormatException: Unknown grbit 
'16'
        at 
org.apache.poi.hssf.record.formula.ArrayPtg.readTokenValues(ArrayPtg.java:98)
        at 
org.apache.poi.hssf.record.formula.Ptg.createParsedExpressionTokens(Ptg.java:109)
        at 
org.apache.poi.hssf.record.NameRecord.fillFields(NameRecord.java:739)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
        at 
org.apache.poi.hssf.record.NameRecord.<init>(NameRecord.java:142)
        ... 10 more
Error in Reading : org.apache.poi.hssf.record.RecordFormatException: 
Unable to c
onstruct record instance, the following exception occured: null


Code snippet:
try
            {
              fs = new FileInputStream(fileToBeRead);
              System.out.println(" file read" );
              FI = new FileInputStream(propertyFile) ;
              FW = new FileWriter(fileToBeWritten);
            }
          catch(FileNotFoundException e)
            {
              throw new Exception(e);
            }
          catch(IOException e)
            {
              throw new Exception(e);
            }
          System.out.println("Before HSSFWorkbook Initiation");
          HSSFWorkbook workbook = new HSSFWorkbook(fs);
          System.out.println("After HSSFWorkbook Initiation");


Exception are right at initializing HSSFWorkbook() - HSSFWorkbook workbook 
= new HSSFWorkbook(fs);

I really appreciate the help.

Thanks,
Sara