// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); ButtonCellType buttonCellType = new ButtonCellType(); buttonCellType.setText("Button"); buttonCellType.setButtonBackColor("Azure"); buttonCellType.setMarginLeft(10); buttonCellType.setMarginRight(10); worksheet.setCellType(buttonCellType);