Forgot to mention that you will need to be careful when making changes to the
style object associated with the cells in your range(s). You may know that
styles are shared - all cells that look the same will most likely share the
same style. As a result, making a cahnge to the style associated with one
cell can result in those changes being reflected in every other cell the
style is applied to. You have a couple of options when modifying the styles
associates with the peripheral cells in your range(s). The first is to just
assume that the style object could be shared and to clone it, modify the
clone and then apply that to the cell. This will work but only up to a point
because Excel imposes a limit on the number of styles a workbook can contain
- at least it did for the older binary format. It would be better - but
inevitably more complex - to determine if any other cells share the same
style object. If not, you could simply modify the style, if on the other
hand, it were shared, you could clone it, modify the clone and then apply
that to the cell. I have not looked into this in any detail yet but that
process may involve iterating through the cells in the worksheet and
checking to see if any share the style object. This could be a long process
and I will look to see if it is possible to short circuit it in any way.

Yours

Mark B

PS In my previous response, I mentioned Ranges. Well you will most likely be
dealing with CellRangeAddress objects not Range objects.

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Range-Border-tp4265910p4266241.html
Sent from the POI - User mailing list archive at Nabble.com.

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

Reply via email to