You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Clauss, Arne" <Ar...@gedas.de> on 2003/03/25 18:18:33 UTC
How to modify cells using the named range
Hello!
I would like to modify an excel-file in an web-application. Because the
design of the excel-file could be changed I would like to use the named
ranges for putting the information into the excel-file. I think, that this
make me independent of design changes (adding new rows an columns).
I just want to get a cell for modifying it by the using the named range of
the cell to find it.
I have found in the class "HSSFWorkbook" the method "getNameIndex". What
should I do with the returned index. I haven't found a method for getting a
HSSFCell with the returned index.
Any help is appreciated.
Kind regards,
Arne
Re: How to modify cells using the named range
Posted by Danny Mui <da...@muibros.com>.
That method simply gives you a HSSFName object that gives you the
formula-based reference (i.e Sheet1!A2:A5).
You can use:
http://jakarta.apache.org/poi/javadocs/org/apache/poi/hssf/util/AreaReference.html
|AreaReference ref = new AreaReference (name.getReference());
That will get you your cell indices, albeit the long way. Maybe this
should be easier?
danny
|
Clauss, Arne wrote:
>Hello!
>
>I would like to modify an excel-file in an web-application. Because the
>design of the excel-file could be changed I would like to use the named
>ranges for putting the information into the excel-file. I think, that this
>make me independent of design changes (adding new rows an columns).
>
>I just want to get a cell for modifying it by the using the named range of
>the cell to find it.
>
>I have found in the class "HSSFWorkbook" the method "getNameIndex". What
>should I do with the returned index. I haven't found a method for getting a
>HSSFCell with the returned index.
>
>Any help is appreciated.
>
>Kind regards,
>
>Arne
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
>
>