Hi Team,
I’m using Aspose Cells (Java) for reading hyperlinks in my excel file.
I’m using the below code, but unable to read hyperlinks in a SmartArt, Images, WordArt etc. I’m only able to parse hyperlinks in exact cells. Can you assist with me with ways to identify hyperlinks in other objects as well.
Also, can we identify if the hyperlink is Internal (pointing to a cell in same excel) or External?
Code Used
Workbook wb = new Workbook(dataDir + fileName);
wsCount = wb.getWorksheets().getCount();
for(int ws = 0; ws<wsCount; ws++){
Worksheet worksheet = wb.getWorksheets().get(ws);
hyperlinkCount = worksheet.getHyperlinks().getCount();
for(int i=0;i<hyperlinkCount;i++){
linkName = worksheet.getHyperlinks().get(i).getTextToDisplay();
linkURL = worksheet.getHyperlinks().get(i).getAddress();
System.out.println(removeSpecialChars(linkName)+ " - "+linkURL);
}
}
Sample File
testHyper2.zip (233.5 KB)
Thanks,
Vineet.