I have a cell which contains a hyperlink and is also formatted.
My goal is to remove the text in the cell and the hyperlink, but leave the formatting untouched.
In Excel, I can use the Clear Contents option in the contextual menu to achieve this.
With Aspose Cells, the method Cells.clearContents only removes the text and I get an empty cell (with the original formatting) which is clickable!
Excel does not allow this - if I only remove the “Text to display” from the hyperlinks properties, Excel replaces it with the link target.
If this behavior is intentional, what is the procedure to achieve my goal?
If I remove the Hyperlink object from the HyperlinkCollection, the formatting goes away too (like the Remove Hyperlink option in Excel).
I’ve attached a small sample which uses Cells 7.0.2 and JDK5.
Workbook wb = new Workbook(“test.xls”);
Worksheet ws = wb.getWorksheets().get(“Sheet1”);
Cells cells = ws.getCells();
cells.clearContents(3, 3, 3, 3); // D4
The hyperlinks.removeAt method is good, but it also removes the formatting (which is correct because Excel does it too) so it’s not the best option for our use case.
A proper clearContents would be better.
What is the current status of this issue?
This release fixes the issue.