// Create a new workbook Workbook workbook = new Workbook(); IWorksheet ws = workbook.getWorksheets().get("Sheet1"); ws.getRange("A:A").setColumnWidthInPixel(30d); ws.getRange("B:B").setColumnWidthInPixel(106d); // Three check states ws.getRange("B2").setValue("A checkbox can have 3 check states."); ICheckBox checkBox1 = ws.getControls().addCheckBox(23.1, 39.6, 88.5, 25.80); checkBox1.setDisplay3DShading(true); checkBox1.setIsChecked(false); ICheckBox checkBox2 = ws.getControls().addCheckBox(23.1, 72, 88.5, 21); checkBox2.setIsChecked(true); checkBox2.setText("Checked"); ICheckBox checkBox3 = ws.getControls().addCheckBox(23.1, 101.4, 88.5, 20.39); checkBox3.setIsChecked(null); checkBox3.setText("Mixed"); // Data binding ws.getRange("B11").setValue("It also supports data binding."); ICheckBox checkBox4 = ws.getControls().addCheckBox(22.5, 175.8, 104.1, 23.39); checkBox4.setLinkedCell(ws.getRange("D13")); checkBox4.setIsChecked(true); // Save to an excel file workbook.save("CheckBoxesBasicUsage.xlsx");