I am looking for a way to retrieve the Cell represented by the getLinkedCell() method of a control such as RadioButton or ComboBox. Is there any easy way to retrieve this?
Thanks for the response. I am unsure how to retrieve the Cell based off of the cell’s address. How do I retrieve the cell based off of the address? For example, if the getLinkedCell() method returns “Sheet1!$A$1”, how would I get the Cell from this address?
Thanks for your input and using Aspose.Cells for Java.
You can use the following code to access your cell and its value. The code removes the sheet name part from the string and also remove the $ sign to get the cell’s name.
After that it uses worksheet.getCells().get() method to access the cell by its name.
//String returned by getLinkedCell() method
String returnedString = “Sheet1!$A$1”;
//Split and parse it to access the cell’s name
String array = returnedString.split("!");
String cellName = array.replace("$", “”);
//Access your cell with cell’s name from your worksheet
Cell cell = worksheet.getCells().get(cellName);
//Print your cell value on console
Thanks for considering Aspose.Cells.
You are welcome. The above code will resolve your issue. Let us know if you still face any issue, we will be glad to assist you further.
Besides, we will recommend you to download and try the offline Aspose.Cells for Java demos. It will help you to be quickly familiar with Aspsoe.Cells for Java API(s).