We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to get picture link datasoruce?

I want to get picture link datasource



Workbook wb = new Workbook(“C:/照相.xlsx”);
ShapeCollection shapes = wb.getWorksheets().get(1).getShapes();
System.out.println(shapes.getCount());
Shape shape = shapes.get(0);
System.out.println(shape);

When debug, I can inspect shape has property d that is "Sheet1!$A$1:$B$2"
But I can’t find method to get this property, it seem Shape.class obfuscates that is
String ad() {
return d;
}


I hope Aspose.Cells can let this public without obfuscated.

Hi,


Thanks for your query and sample code.

Well, you may get the Picture shape object and retrieve the formula that denotes the linked data source for the shape, see the updated sample code for your reference:
e.g
Sample code:

Workbook wb = new Workbook(stringFilePath);
ShapeCollection shapes = wb.getWorksheets().get(1).getShapes();
System.out.println(shapes.getCount());
Shape shape = shapes.get(0);
System.out.println(shape);
Picture pic = (com.aspose.cells.Picture)shape;
System.out.println(pic.getFormula());

Hope, this helps a bit.

Thank you.