• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

POI, Excel 2010 - howto remove Hyperlink from cell

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tried by it does not accept NULL

really frustrating..
 
Sheriff
Posts: 22815
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried overriding the cell contents completely, e.g. using setCellValue?
 
Yes, of course, and I accept that blame. In fact, i covet that blame. As does this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic