We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Reading from Excel for AtciveX Control for Checkbox or radio button value


Need help in reading the ActiveX Control for checkbox & radio button components?
If you have any sample, please share the sample programs.

Reading the Excel only type is string but not components like Checkbox & radio button components:

Workbook workbook = new Workbook(new FileInputStream(“path\ v0.6.xlsx”),loadOptions);
Worksheet sheet = workbook.getWorksheets().get(1);
System.out.println(" Active cell : “+ workbook.getWorksheets().get(1).getActiveCell());

//CheckBoxCollection checks = workbook.getWorksheets().get(1).getCheckBoxes();

// System.out.println(checks.get(119).getCheckedValue());
Cells cells = sheet.getCells();
Iterator cellIterator = cells.iterator();
while(cellIterator.hasNext()) {
Cell cell = cellIterator.next();

System.out.println((cell.getValue() != null?cell.getValue().toString() : null) +” : Cell : “+cell.getType() +” : row : "+cell.getRow() + " Column : "+cell.getColumn());

please help me in the reading the Excel ActiveXControls.

Hi Dinesh,

Thanks for your posting and using Aspose.Cells for Java.

We are afraid, Aspose.Cells does not support reading ActiveX Control values. However, you can acquire all of the ActiveX Control in the form of binary data. But you cannot manipulate this binary data using Aspose.Cells APIs.

To read entire ActiveX control in the binary form, you can use the Shape.getControlData() property.

However, Aspose.Cells can be used to create or manipulate Form Controls. Please see the following documentation article about Form Controls for your reference

( http://www.aspose.com/docs/display/cellsjava/Working+with+Controls )

Hi Faiz,

Thanks for your replay. Could please prove the example for the getting binary detail Shape.getControlData() from Aspose.Cells.

I am using Asponse-cells- i don’t find any Class called Shape. Could suggest me which Api need to be used?

For example, need to read binary data from the Row 2 & Column 2 having the check box, Then how can i get the binary data from Shape.getControlData().?

Thanks in advance for your help.

I got the Shape.getControlData() in the Aspose-Cells- .

Shape.getControlData() : Byte[] how could it help me reading the value of ActiveX Control?


Thanks for your posting and considering Aspose.Cells for Java.

Shape.getControlData() method was introduced in Aspose.Cells for Java v7.7.1 so you need to use the v7.7.1 or greater to use this property.

Please see the following code. I have attached the source.xlsm used inside it for your reference.


String filePath = “F:\Shak-Data-RW\Downloads\source.xlsm”;

Workbook workbook = new Workbook(filePath);

Worksheet worksheet = workbook.getWorksheets().get(0);

Shape shape = worksheet.getShapes().get(0);

byte[] data = shape.getControlData();




Well, currently using Aspose.Cells APIs, you can only get ActiveX controls’ data in byte array, so you could get/create a picture from it if you want. I am a fraid, you cannot evaluate or get the value e.g checked or unchecked for the ActiveX controls like Checkbox or radio button. etc., it is not supported at the moment.

Thank you.