Hello,

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!

Moreover, calling
AreaReference.generateContiguous(aNamedCell.getRefersToFormula())
throws "java.lang.IllegalArgumentException: Invalid Formula cell
reference: 'OFFSET(Sheet1!$B'"

What I am trying to do is define a named range on the first two
columns of the first sheet and then programmatically add data to the
first sheet and not break the range.

Thoughts?

Thanks,

Alec

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

Reply via email to