On Tue, 27 Sep 2011, Alec Swan wrote:
I have a named range defined as
OFFSET(Sheet1!$B:$B,1,,COUNT(Sheet1!$B:$B),). I followed the
documentation and accessed the range as follows:

   Name aNamedCell = targetWb.getName("DynamicChartData");
   AreaReference aref = new AreaReference(aNamedCell.getRefersToFormula());

However, the last line throws "IllegalArgumentException: References
passed to the AreaReference must be contiguous, use
generateContiguous(ref) if you have non-contiguous references", but
the range is contiguous!

Are you able to step into that code in (say) the eclipse debugger, and track down why it's deciding that isn't contiguous?

One slight "fun" issue is that the formula isn't stored as the text, it's stored in a parsed form (PTG). We have to turn that back into text for display, and you're tripping over the code that handles that

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to