// Create a new workbook Workbook workbook = new Workbook(); IWorksheet ws = workbook.getWorksheets().get("Sheet1"); String rngB1 = "Document Solutions for Excel Product Feedback - Form Controls"; ws.getRange("$B$1").setValue(rngB1); Object rngB3I3 = new Object[][] { { "Please take a moment to let us know your feedback about Form Controls in Document Solutions for Excel. Your feedback is valuable and will help us to improve our product and better serve our customers.", null, null, null, null, null, null, null} }; ws.getRange("$B$3:$I$3").setValue(rngB3I3); String rngB5 = "1. How difficult is it to use the Form Controls in Document Solutions for Excel?"; ws.getRange("$B$5").setValue(rngB5); Object rngD7I7 = new Object[][] { { "Very difficult", "Difficult", "Neutral", "Easy", "Very easy", "I've never tried to use the feature because I don't know how."} }; ws.getRange("$D$7:$I$7").setValue(rngD7I7); Object rngB8B13 = new Object[][] { { "Create and initialize controls"}, { "Access controls in a worksheet"}, { "Read/write properties"}, { "Copy/cut controls"}, { "Range based data binding"}, { "Port existing code that uses Excel Form Controls"} }; ws.getRange("$B$8:$B$13").setValue(rngB8B13); String rngB15 = "2. What new features would you like to see in the Form Controls in Document Solutions for Excel?"; ws.getRange("$B$15").setValue(rngB15); String rngB21 = "3. Please rank the following in order of importance"; ws.getRange("$B$21").setValue(rngB21); Object rngB23C25 = new Object[][] { { 1d, "Compatibility of files exported by Microsoft Excel"}, { 2d, "New features"}, { 3d, "Performance"} }; ws.getRange("$B$23:$C$25").setValue(rngB23C25); String rngB27 = "4. Which programming language are you primarily using to access Form Controls with Document Solutions for Excel?"; ws.getRange("$B$27").setValue(rngB27); Object rngI28I30 = new Object[][] { { ".NET languages (C#, VB.NET, F#, C++/CLI,...)"}, { "JVM languages (Java, Kotlin,...)"}, { "Scripting languages (PowerShell, IronPython,...)"} }; ws.getRange("$I$28:$I$30").setValue(rngI28I30); String rngE29 = "Other:"; ws.getRange("$E$29").setValue(rngE29); String rngB31 = "5. Would you like to suggest this feature to your colleagues?"; ws.getRange("$B$31").setValue(rngB31); Object rngA33B33 = new Object[][] { { 5d, "Very unlikely"} }; ws.getRange("$A$33:$B$33").setValue(rngA33B33); String rngI33 = "Very likely"; ws.getRange("$I$33").setValue(rngI33); Object rngB37I37 = new Object[][] { { "6. Thank you for taking our survey. Your feedback is important and will help us create a better product for you and other developers.", null, null, null, null, null, null, null} }; ws.getRange("$B$37:$I$37").setValue(rngB37I37); String rngB39 = "Name"; ws.getRange("$B$39").setValue(rngB39); String rngB41 = "Email"; ws.getRange("$B$41").setValue(rngB41); IRange style1 = ws.getRange("$A$8:$A$13,$A$29,$E$32,$A$33"); style1.setNumberFormat(";;;"); IRange style2 = ws.getRange("$B$23:$B$25"); style2.setNumberFormat("\"P\"0"); IFont style3 = ws.getRange("$B$1:$I$1").getFont(); style3.setThemeColor(ThemeColor.Dark2); style3.setBold(true); style3.setSize(15d); IFont style4 = ws.getRange("$B$5:$I$5,$B$15:$I$15,$B$21:$I$21,$B$27:$I$27,$B$31:$I$31,$B$37:$I$37").getFont(); style4.setThemeColor(ThemeColor.Dark2); style4.setBold(true); style4.setSize(13d); IFont style5 = ws.getRange("$I$28:$I$30").getFont(); style5.setThemeColor(ThemeColor.Light1); IBorders style6 = ws.getRange("$B$1:$I$1").getBorders(); style6.get(BordersIndex.EdgeBottom).setThemeColor(ThemeColor.Accent1); style6.get(BordersIndex.EdgeBottom).setLineStyle(BorderLineStyle.Thick); IBorders style7 = ws.getRange("$B$5:$I$5,$B$15:$I$15,$B$21:$I$21,$B$27:$I$27,$B$31:$I$31,$B$37:$I$37").getBorders(); style7.get(BordersIndex.EdgeBottom).setThemeColor(ThemeColor.Accent1); style7.get(BordersIndex.EdgeBottom).setLineStyle(BorderLineStyle.Thick); IBorders style8 = ws.getRange("$C$39,$C$41").getBorders(); style8.get(BordersIndex.EdgeBottom).setThemeColor(ThemeColor.Light2); style8.get(BordersIndex.EdgeBottom).setLineStyle(BorderLineStyle.Medium); style8.get(BordersIndex.EdgeLeft).setThemeColor(ThemeColor.Light2); style8.get(BordersIndex.EdgeLeft).setLineStyle(BorderLineStyle.Medium); style8.get(BordersIndex.EdgeRight).setThemeColor(ThemeColor.Light2); style8.get(BordersIndex.EdgeRight).setLineStyle(BorderLineStyle.Medium); style8.get(BordersIndex.EdgeTop).setThemeColor(ThemeColor.Light2); style8.get(BordersIndex.EdgeTop).setLineStyle(BorderLineStyle.Medium); IBorders style9 = ws.getRange("$E$19,$F$29").getBorders(); style9.get(BordersIndex.EdgeBottom).setThemeColor(ThemeColor.Light2); style9.get(BordersIndex.EdgeBottom).setLineStyle(BorderLineStyle.Medium); style9.get(BordersIndex.EdgeLeft).setThemeColor(ThemeColor.Light2); style9.get(BordersIndex.EdgeLeft).setLineStyle(BorderLineStyle.Medium); style9.get(BordersIndex.EdgeTop).setThemeColor(ThemeColor.Light2); style9.get(BordersIndex.EdgeTop).setLineStyle(BorderLineStyle.Medium); IBorders style10 = ws.getRange("$F$19,$G$29").getBorders(); style10.get(BordersIndex.EdgeBottom).setThemeColor(ThemeColor.Light2); style10.get(BordersIndex.EdgeBottom).setLineStyle(BorderLineStyle.Medium); style10.get(BordersIndex.EdgeTop).setThemeColor(ThemeColor.Light2); style10.get(BordersIndex.EdgeTop).setLineStyle(BorderLineStyle.Medium); IBorders style11 = ws.getRange("$G$19,$H$29").getBorders(); style11.get(BordersIndex.EdgeBottom).setThemeColor(ThemeColor.Light2); style11.get(BordersIndex.EdgeBottom).setLineStyle(BorderLineStyle.Medium); style11.get(BordersIndex.EdgeRight).setThemeColor(ThemeColor.Light2); style11.get(BordersIndex.EdgeRight).setLineStyle(BorderLineStyle.Medium); style11.get(BordersIndex.EdgeTop).setThemeColor(ThemeColor.Light2); style11.get(BordersIndex.EdgeTop).setLineStyle(BorderLineStyle.Medium); IRange style12 = ws.getRange("$B$3:$I$3"); style12.setHorizontalAlignment(HorizontalAlignment.Left); style12.setVerticalAlignment(VerticalAlignment.Center); style12.setWrapText(true); style12.setAddIndent(false); IRange style13 = ws.getRange("$B$8,$C$23:$C$25,$E$29"); style13.setVerticalAlignment(VerticalAlignment.Center); style13.setAddIndent(false); IRange style14 = ws.getRange("$B$9:$B$13,$B$23:$B$25"); style14.setHorizontalAlignment(HorizontalAlignment.Left); style14.setVerticalAlignment(VerticalAlignment.Center); style14.setAddIndent(false); IRange style15 = ws.getRange("$B$37:$I$37"); style15.setHorizontalAlignment(HorizontalAlignment.Left); style15.setWrapText(true); style15.setAddIndent(false); IRange style16 = ws.getRange("$D$7:$H$7,$E$19:$G$19,$F$29:$H$29"); style16.setHorizontalAlignment(HorizontalAlignment.Center); style16.setAddIndent(false); IRange style17 = ws.getRange("$I$7"); style17.setWrapText(true); style17.setAddIndent(false); ws.getRange("$B$3:$I$3").merge(); ws.getRange("$E$19:$G$19").merge(); ws.getRange("$B$37:$I$37").merge(); ws.getRange("$F$29:$H$29").merge(); ws.getRange("$1:$1").setRowHeight(20.4d); ws.getRange("$3:$3").setRowHeight(32.4d); ws.getRange("$5:$5,$15:$15,$27:$27,$31:$31").setRowHeight(18d); ws.getRange("$7:$7").setRowHeight(57.6d); ws.getRange("$8:$9,$11:$13").setRowHeight(24d); ws.getRange("$10:$10").setRowHeight(25.2d); ws.getRange("$17:$21,$39:$39").setRowHeight(18.6d); ws.getRange("$23:$25").setRowHeight(24.6d); ws.getRange("$28:$28,$38:$38").setRowHeight(15.6d); ws.getRange("$29:$29").setRowHeight(27d); ws.getRange("$37:$37").setRowHeight(37.8d); ws.getRange("$40:$40").setRowHeight(10.2d); ws.getRange("$41:$41").setRowHeight(19.8d); ws.getRange("$A:$A").setColumnWidthInPixel(36d); ws.getRange("$B:$B").setColumnWidthInPixel(57d); ws.getRange("$C:$C").setColumnWidthInPixel(260d); ws.getRange("$D:$D").setColumnWidthInPixel(107d); ws.getRange("$I:$I").setColumnWidthInPixel(139d); ws.getRange("$J:$J").setColumnWidthInPixel(48d); IOptionButton ctl1 = ws.getControls().addOptionButton(580, 177.6, 26.39, 16.20); ctl1.setLinkedCell(ws.getRange("$A$8")); ctl1.setText(""); IOptionButton ctl2 = ws.getControls().addOptionButton(299.95, 178.20, 26.40, 16.19); ctl2.setLinkedCell(ws.getRange("$A$8")); ctl2.setText(""); IOptionButton ctl3 = ws.getControls().addOptionButton(361.8, 178.20, 26.39, 16.19); ctl3.setLinkedCell(ws.getRange("$A$8")); ctl3.setText(""); IOptionButton ctl4 = ws.getControls().addOptionButton(407.8, 178.20, 26.39, 16.19); ctl4.setLinkedCell(ws.getRange("$A$8")); ctl4.setText(""); IOptionButton ctl5 = ws.getControls().addOptionButton(455.2, 177.6, 26.40, 16.20); ctl5.setLinkedCell(ws.getRange("$A$8")); ctl5.setText(""); IGroupBox ctl6 = ws.getControls().addGroupBox(266.55, 175.8, 370, 20.40); ctl6.setText(""); IOptionButton ctl7 = ws.getControls().addOptionButton(507.4, 178.20, 23.39, 16.19); ctl7.setLinkedCell(ws.getRange("$A$8")); ctl7.setText(""); IOptionButton ctl8 = ws.getControls().addOptionButton(580, 201.6, 26.39, 16.19); ctl8.setLinkedCell(ws.getRange("$A$9")); ctl8.setText(""); IOptionButton ctl9 = ws.getControls().addOptionButton(299.95, 202.20, 26.39, 16.19); ctl9.setLinkedCell(ws.getRange("$A$9")); ctl9.setText(""); IOptionButton ctl10 = ws.getControls().addOptionButton(361.8, 202.20, 26.39, 16.19); ctl10.setLinkedCell(ws.getRange("$A$9")); ctl10.setText(""); IOptionButton ctl11 = ws.getControls().addOptionButton(407.8, 202.20, 26.39, 16.19); ctl11.setLinkedCell(ws.getRange("$A$9")); ctl11.setText(""); IOptionButton ctl12 = ws.getControls().addOptionButton(455.2, 201.6, 26.39, 16.19); ctl12.setLinkedCell(ws.getRange("$A$9")); ctl12.setText(""); IGroupBox ctl13 = ws.getControls().addGroupBox(266.55, 199.8, 370, 20.40); ctl13.setText(""); IOptionButton ctl14 = ws.getControls().addOptionButton(507.4, 202.20, 23.39, 16.19); ctl14.setLinkedCell(ws.getRange("$A$9")); ctl14.setText(""); IOptionButton ctl15 = ws.getControls().addOptionButton(580, 225.6, 26.39, 16.19); ctl15.setLinkedCell(ws.getRange("$A$10")); ctl15.setText(""); IOptionButton ctl16 = ws.getControls().addOptionButton(299.95, 226.20, 26.39, 16.19); ctl16.setLinkedCell(ws.getRange("$A$10")); ctl16.setText(""); IOptionButton ctl17 = ws.getControls().addOptionButton(361.8, 226.20, 26.39, 16.19); ctl17.setLinkedCell(ws.getRange("$A$10")); ctl17.setText(""); IOptionButton ctl18 = ws.getControls().addOptionButton(407.8, 226.20, 26.39, 16.19); ctl18.setLinkedCell(ws.getRange("$A$10")); ctl18.setText(""); IOptionButton ctl19 = ws.getControls().addOptionButton(455.2, 225.6, 26.39, 16.19); ctl19.setLinkedCell(ws.getRange("$A$10")); ctl19.setText(""); IGroupBox ctl20 = ws.getControls().addGroupBox(266.55, 223.8, 370, 20.40); ctl20.setText(""); IOptionButton ctl21 = ws.getControls().addOptionButton(507.4, 226.20, 23.39, 16.19); ctl21.setLinkedCell(ws.getRange("$A$10")); ctl21.setText(""); IOptionButton ctl22 = ws.getControls().addOptionButton(580, 250.79, 26.39, 16.20); ctl22.setLinkedCell(ws.getRange("$A$11")); ctl22.setText(""); IOptionButton ctl23 = ws.getControls().addOptionButton(299.95, 251.4, 26.39, 16.20); ctl23.setLinkedCell(ws.getRange("$A$11")); ctl23.setText(""); IOptionButton ctl24 = ws.getControls().addOptionButton(361.8, 251.4, 26.39, 16.20); ctl24.setLinkedCell(ws.getRange("$A$11")); ctl24.setText(""); IOptionButton ctl25 = ws.getControls().addOptionButton(407.8, 251.4, 26.39, 16.20); ctl25.setLinkedCell(ws.getRange("$A$11")); ctl25.setText(""); IOptionButton ctl26 = ws.getControls().addOptionButton(455.2, 250.79, 26.39, 16.20); ctl26.setLinkedCell(ws.getRange("$A$11")); ctl26.setText(""); IGroupBox ctl27 = ws.getControls().addGroupBox(266.55, 249, 370, 20.39); ctl27.setText(""); IOptionButton ctl28 = ws.getControls().addOptionButton(507.4, 251.4, 23.39, 16.20); ctl28.setLinkedCell(ws.getRange("$A$11")); ctl28.setText(""); ICheckBox ctl29 = ws.getControls().addCheckBox(28.8, 367.20, 66.75, 16.79); ctl29.setText("Rich text"); ICheckBox ctl30 = ws.getControls().addCheckBox(29.4, 385.80, 151.35, 16.79); ctl30.setText("Styles, such as color and lines"); ICheckBox ctl31 = ws.getControls().addCheckBox(29.4, 405.00, 151.35, 16.80); ctl31.setText("Scale"); ICheckBox ctl32 = ws.getControls().addCheckBox(174.15, 367.8, 175.04, 16.80); ctl32.setText("Alternative text"); ICheckBox ctl33 = ws.getControls().addCheckBox(174.15, 385.20, 175.04, 16.80); ctl33.setText("Grouping"); ICheckBox ctl34 = ws.getControls().addCheckBox(174.15, 404.40, 175.04, 16.79); ctl34.setText("Attach to macros"); ICheckBox ctl35 = ws.getControls().addCheckBox(345.6, 367.8, 165, 16.80); ctl35.setText("Use formula in buttons"); ICheckBox ctl36 = ws.getControls().addCheckBox(345.6, 385.80, 165, 16.79); ctl36.setText("Other (please specify)"); ISpinner ctl37 = ws.getControls().addSpinner(45.6, 476.40, 17.4, 21); ctl37.setMax(3); ctl37.setMin(1); ctl37.setSmallChange(1); ctl37.setLinkedCell(ws.getRange("$B$23")); ctl37.setValue(1); ISpinner ctl38 = ws.getControls().addSpinner(45.6, 501.00, 17.4, 20.99); ctl38.setMax(3); ctl38.setMin(1); ctl38.setSmallChange(1); ctl38.setLinkedCell(ws.getRange("$B$24")); ctl38.setValue(2); ISpinner ctl39 = ws.getControls().addSpinner(45.6, 525.60, 17.4, 21); ctl39.setMax(3); ctl39.setMin(1); ctl39.setSmallChange(1); ctl39.setLinkedCell(ws.getRange("$B$25")); ctl39.setValue(3); IOptionButton ctl40 = ws.getControls().addOptionButton(580, 298.8, 26.39, 16.20); ctl40.setLinkedCell(ws.getRange("$A$13")); ctl40.setText(""); IOptionButton ctl41 = ws.getControls().addOptionButton(299.95, 299.40, 26.39, 16.20); ctl41.setLinkedCell(ws.getRange("$A$13")); ctl41.setText(""); IOptionButton ctl42 = ws.getControls().addOptionButton(361.8, 299.40, 26.39, 16.20); ctl42.setLinkedCell(ws.getRange("$A$13")); ctl42.setText(""); IOptionButton ctl43 = ws.getControls().addOptionButton(407.8, 299.40, 26.39, 16.20); ctl43.setLinkedCell(ws.getRange("$A$13")); ctl43.setText(""); IOptionButton ctl44 = ws.getControls().addOptionButton(455.2, 298.8, 26.39, 16.20); ctl44.setLinkedCell(ws.getRange("$A$13")); ctl44.setText(""); IGroupBox ctl45 = ws.getControls().addGroupBox(266.55, 297, 370, 20.40); ctl45.setText(""); IOptionButton ctl46 = ws.getControls().addOptionButton(507.4, 299.40, 23.39, 16.20); ctl46.setLinkedCell(ws.getRange("$A$13")); ctl46.setText(""); IOptionButton ctl47 = ws.getControls().addOptionButton(580, 274.8, 26.39, 16.20); ctl47.setLinkedCell(ws.getRange("$A$12")); ctl47.setText(""); IOptionButton ctl48 = ws.getControls().addOptionButton(299.95, 275.40, 26.39, 16.20); ctl48.setLinkedCell(ws.getRange("$A$12")); ctl48.setText(""); IOptionButton ctl49 = ws.getControls().addOptionButton(361.8, 275.40, 26.39, 16.20); ctl49.setLinkedCell(ws.getRange("$A$12")); ctl49.setText(""); IOptionButton ctl50 = ws.getControls().addOptionButton(407.8, 275.40, 26.39, 16.20); ctl50.setLinkedCell(ws.getRange("$A$12")); ctl50.setText(""); IOptionButton ctl51 = ws.getControls().addOptionButton(455.2, 274.8, 26.39, 16.20); ctl51.setLinkedCell(ws.getRange("$A$12")); ctl51.setText(""); IGroupBox ctl52 = ws.getControls().addGroupBox(266.55, 273, 370, 20.40); ctl52.setText(""); IOptionButton ctl53 = ws.getControls().addOptionButton(507.4, 275.40, 23.39, 16.20); ctl53.setLinkedCell(ws.getRange("$A$12")); ctl53.setText(""); IDropDown ctl54 = ws.getControls().addDropDown(30, 599.40, 213.15, 20.39); ctl54.setDropDownLines(3); ctl54.setItemsSourceRange(ws.getRange("$I$28:$I$30")); ctl54.setSelectedIndex(-1); ctl54.setLinkedCell(ws.getRange("$A$29")); ctl54.setValue(0); IScrollBar ctl55 = ws.getControls().addScrollBar(31.2, 690.60, 576, 24.60); ctl55.setLargeChange(1); ctl55.setOrientation(FormControlOrientation.Horizontal); ctl55.setMax(10); ctl55.setMin(0); ctl55.setSmallChange(1); ctl55.setLinkedCell(ws.getRange("$A$33")); ctl55.setValue(8); IButton ctl56 = ws.getControls().addButton(265.35, 851.40, 127.04, 45); ctl56.setHorizontalTextAlignment(HorizontalAlignment.Center); ctl56.setOrientation(TickLabelOrientation.OrientationHorizontal); ctl56.setVerticalTextAlignment(VerticalAlignment.Center); ctl56.setDefaultButton(true); ctl56.setText("Submit"); ILabel ctl57 = ws.getControls().addLabel(292.35, 671.40, 60.60, 18.00); ctl57.setText("I'm not sure"); ILabel ctl58 = ws.getControls().addLabel(433.8, 672.60, 66.59, 18.60); ctl58.setText("Likely"); ILabel ctl59 = ws.getControls().addLabel(143.55, 672.00, 60.59, 18.60); ctl59.setText("Unlikely"); // Save to an excel file workbook.save("FeedbackForm.xlsx");