You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Alec Swan <al...@gmail.com> on 2011/09/23 20:02:40 UTC

Modifying named ranges

Hello,

I have an Excel sheet with a named range. What API do I use to access
the range by name and remove and add rows to it? Is the same possible
with named tables?

Thanks,

Alec

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


Re: Modifying named ranges

Posted by Alec Swan <al...@gmail.com>.
Thanks, this definitely helps.

I'd like to describe my scenario and ask if I am doing something wrong.

* I manually declared a named range in Excel as follows
=OFFSET($B:$B,1,,COUNT($B:$B),)
* I create a chart which uses the named range as data source
* I used POI to clear the sheet and write new data in it.
* When I open the file Excel shows the following error:
"Excel found unreadable content in 'report1.xlsx'. Do you want to
recover the contents of this workbook? If you trust the source of this
workbook, click Yes."
* I click Yes, and see an Excel information dialog saying "Excel was
able to open the file by removing or repairing the unreadable
content." and "Removed Records: Named range from /xl/workbook.xml part
(Workbook)".
* I can see that the file contains new data and the chart has been updated.

What am I doing wrong that causes Excel errors?

Thanks,

Alec


On Fri, Sep 23, 2011 at 1:46 PM, Nick Burch <ni...@alfresco.com> wrote:
> On Fri, 23 Sep 2011, Alec Swan wrote:
>>
>> I have an Excel sheet with a named range. What API do I use to access the
>> range by name and remove and add rows to it? Is the same possible with named
>> tables?
>
> I think this should all be covered in the docs:
> http://poi.apache.org/spreadsheet/quick-guide.html#NamedRanges
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

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


Re: Modifying named ranges

Posted by Nick Burch <ni...@alfresco.com>.
On Fri, 23 Sep 2011, Alec Swan wrote:
> I have an Excel sheet with a named range. What API do I use to access 
> the range by name and remove and add rows to it? Is the same possible 
> with named tables?

I think this should all be covered in the docs:
http://poi.apache.org/spreadsheet/quick-guide.html#NamedRanges

Nick

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