@@ -372,7 +372,11 @@ func (f *File) commentsWriter() {
372
372
// by given worksheet name and form control options. Supported form control
373
373
// type: button, check box, group box, label, option button, scroll bar and
374
374
// spinner. If set macro for the form control, the workbook extension should be
375
- // XLSM or XLTM. Scroll value must be between 0 and 30000.
375
+ // XLSM or XLTM. Scroll value must be between 0 and 30000. Please note that if a
376
+ // cell link is set for a checkbox form control, Excelize will not assign a
377
+ // value to the linked cell when the checkbox is checked. To reflect the
378
+ // checkbox state, please use the 'SetCellValue' function to manually set the
379
+ // linked cell's value to true.
376
380
//
377
381
// Example 1, add button form control with macro, rich-text, custom button size,
378
382
// print property on Sheet1!A2, and let the button do not move or size with
@@ -826,6 +830,9 @@ func (f *File) addFormCtrlShape(preset formCtrlPreset, col, row int, anchor stri
826
830
if (opts .Type == FormControlCheckBox || opts .Type == FormControlOptionButton ) && opts .Checked {
827
831
sp .ClientData .Checked = 1
828
832
}
833
+ if opts .FormControl .Type == FormControlCheckBox {
834
+ sp .ClientData .FmlaLink = opts .CellLink
835
+ }
829
836
return & sp , sp .addFormCtrl (opts )
830
837
}
831
838
0 commit comments