// Create a new workbook Workbook workbook = new Workbook(); IWorksheet ws = workbook.getWorksheets().get("Sheet1"); ws.getRange("8:8").setRowHeight(7.8d); ws.getRange("9:9").setRowHeight(25.8d); ws.getRange("A:A").setColumnWidthInPixel(36d); // Unbound mode ws.getRange("B2").setValue("Spinners support unbound mode. You can modify its value with code."); ISpinner spinner1 = ws.getControls().addSpinner(33.3, 36.2, 36.3, 41.5); spinner1.setMax(10); spinner1.setMin(1); spinner1.setValue(6); // Data binding ws.getRange("B7").setValue("The following spinner is similar to a numeric up-down. Because it's linked to a cell."); ws.getRange("B9").setValue(6d); IRange b9 = ws.getRange("B9"); b9.setHorizontalAlignment(HorizontalAlignment.Left); b9.setVerticalAlignment(VerticalAlignment.Center); b9.setAddIndent(false); ISpinner spinner2 = ws.getControls().addSpinner(48.5, 113.5, 25.5, b9.getHeight() - 2); spinner2.setMax(10); spinner2.setMin(1); spinner2.setDisplay3DShading(false); spinner2.setLinkedCell(b9); spinner2.setValue(6); // Save to an excel file workbook.save("SpinnersBasicUsage.xlsx");