Bug 62170 - NumberFormatException when trying to get reference from named range with getRefersToFormula()
Summary: NumberFormatException when trying to get reference from named range with getR...
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.17-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-09 15:12 UTC by stephane.tesoka
Modified: 2018-03-09 16:55 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stephane.tesoka 2018-03-09 15:12:48 UTC
When I try to get the reference behing my named range via the getRefersToFormula() function, in some cases, I get a NumberFormatException.
It depends on the sheet name where the named range is, for example :
- the named range is in a sheet named '2620000001', it's OK. 
- the named range is in a sheet named 'C2620000001', it fails -> i don't know why but it seems POI considers that it's a number and tries to parse it into a string, thus the NumberFormatException : 2620000001 is higher than the int limit 2^31-1

When I check the named cells in Excel's name manager, sometimes the sheet name is surrouded with quotes, sometimes it isn't.
Note that when there are quotes, it works everytime with POI. Otherwise, it fails sometimes (cf. the case mentionned before, Excel doesn't add quotes with the sheet name C2620000001)
Comment 1 stephane.tesoka 2018-03-09 16:55:08 UTC
After further investigations, it seems that the problem only concerns XLS files. It works fine with XLSX files.