Greetings,
I’ve got a quick question regarding the real-time functionality of a check box and a linked cell. Assuming I that I do the following:
//Instantiate a new Workbook.
Workbook workbook = new Workbook();
//Get the first worksheet in the book.
Worksheet worksheet = workbook.getWorksheets().getSheet(0);
//Add a checkbox to the first worksheet in the workbook.
com.aspose.cells.CheckBox checkBox = worksheet.getShapes().addCheckBox(5,5,100,120,50,50);
//Set its text string.
checkBox.setText(“Check it!”);
//Put a value into B1 cell.
worksheet.getCells().getCell(“B1”).setValue(“LnkCell”);
//Set B1 cell as a linked cell for the checkbox.
checkBox.setLinkedCell(“B1”);
//Change to value of the check box via the linked cell
worksheet.getCells().getCell(“B1”).setValue(“true”);
System.out.println(checkBox.getCheckValue()); // Should this reflect the linked cell change?
Will the check box be updated (real-time) as a result of changing the linked cell value, or do I need to save the workbook and reload it in order to see the change? The reason I ask is because I’m trying to update a check box via the linked cell and am not seeing the changes reflected in the check box state (CheckBox.getCheckValue()).
Thank you for your help.