poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46973] New: IllegalArgumentException when calling Name.isDeleted().
Date Mon, 06 Apr 2009 10:14:21 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46973

           Summary: IllegalArgumentException when calling
                    Name.isDeleted().
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: matthew.knl@gmail.com


I use following codes to read attached "problem.xls" Excel file to list the
named 
ranges. But it throws IllegalArgumentException when calling
namedRange.isDeleted().

--

FileInputStream fis = new FileInputStream("problem.xls");
POIFSFileSystem poifs = new POIFSFileSystem(fis);
HSSFWorkbook excelWB = new HSSFWorkbook(poifs);
for (int i = 0; i < excelWB.getNumberOfNames(); i++)
{
    try
    {
        Name namedRange = excelWB.getNameAt(i);
        if (namedRange.isFunctionName() || namedRange.isDeleted())
        {
            continue;
        }
        System.out.println("name: " + namedRange.getNameName());
    }
    catch (Exception ex)
    {
        logger.error("Read named range failed.");
        logger.error(ex, ex);
        System.out.println(ex);
    }
}

--

Exception details:

java.lang.IllegalArgumentException: ptgs must not be null
    at
org.apache.poi.ss.formula.FormulaRenderer.toFormulaString(FormulaRenderer.java:48)
    at
org.apache.poi.hssf.model.HSSFFormulaParser.toFormulaString(HSSFFormulaParser.java:80)
    at
org.apache.poi.hssf.usermodel.HSSFName.getRefersToFormula(HSSFName.java:192)
    at org.apache.poi.hssf.usermodel.HSSFName.isDeleted(HSSFName.java:201)

--

Please help to check this issue. Thanks!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message