• Post Reply Bookmark Topic Watch Topic
  • New Topic

POI, Excel 2010 - howto remove Hyperlink from cell  RSS feed

 
nicolas diogo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello

i am trying to delete the hyperlinks from cells withing a range.

and i can not understand:

- which method to use to remove the hyperlink of a cell
- if i can use Excel coordinates to define a range (eg: B2:L45)

i have managed to delete the content of cells but the hyperlinks are still there.
in fact, i have searched the documentation of POI website on google:
excel poi (remove OR delete) hyperlink site:http://poi.apache.org

but nothing has been found


these are the portion of the class that i am working on:




thanks in advance,
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi nicolas,

Welcome to CodeRanch!

Please, UseCodeTags. I've added those for you this time.

Coming to your question, the most important thing to understand is - which cell is having hyperlink.

I think Apache POI quick guide(<-click) might help you.

I guess setting the hyperlink to null should resolve the issue - but frankly, I haven't tried it yet.

I hope this helps.
 
nicolas diogo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the editing.

i have checked your suggested page. and bookmarked it.

but i am still not able to remove links from existing cells.

maybe someone else will be able to give a suggestion.

i am sure it will be something simple.

i tried the following without success:



thanks,
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi nicolas,

You are still setting an empty hyperlink.

Did you try this:Again, I'm not 100% sure about it (I hope it won't throw a NPE).
 
nicolas diogo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tried by it does not accept NULL

really frustrating..
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried overriding the cell contents completely, e.g. using setCellValue?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!