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

Free Support Forum - aspose.com

Checkbox with Excel 2007

Hi,

one of our customers is having an issue witch their documents. Sadly we are not allowed to upload the full excel document, including the content and as if we try removing it´s content manually via excel, the file structure gets changed such a lot that it that it isn´t useful any more to provide you as an example but I will try to explain as good as possible and can provide some parts of the file.

So first, this is how their document looks like, it contains checkboxes:
image.jpg (32.0 KB)

We got the information that the document originally has been an xls file and they switched to xlsx. They are using Office 2007.
When opening their original file with excel 2007, you are able to tick and untick those checkboxes. As soon as you only open and save the document via Aspose, they have the issue, that they cannot the checkboxes any more. They are still there, they can be selected but not ticked any more. We already made sure that excel is not in the developer / editing mode where you add and change those elements.
It seems like only Excel 2007 is affected by the issues, we tried 2010 and 2016 without having issues but were able to reproduce the problem with 2007.

Some analysis we already did which may help you:
We opened the excel document with a zip tool and have compared them, as we noticed major differences in the file size.
In the original xlsx file, the checkboxes are marked up as following inside the /xl/worksheets/sheet1.xml:

<controls>
  <control r:id="rId3" name="CheckBox7" shapeId="1164"/>
  <control r:id="rId4" name="CheckBox28" shapeId="1058"/>
  <control r:id="rId5" name="CheckBox27" shapeId="1057"/>
  <control r:id="rId6" name="CheckBox26" shapeId="1056"/>
  <control r:id="rId7" name="CheckBox22" shapeId="1052"/>
</controls>

If you save the document using aspose, not changing anything, as xlsx, that structure is changed to this:

<controls>
  <mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <mc:Choice Requires="x14">
      <control r:id="rId2" name="CheckBox2" shapeId="1">
        <controlPr r:id="rId1" autoLine="0" defaultSize="0">
          <anchor>
            <from>
              <xdr:col>2</xdr:col>
              <xdr:colOff>66675</xdr:colOff>
              <xdr:row>4</xdr:row>
              <xdr:rowOff>19050</xdr:rowOff>
            </from>
            <to>
              <xdr:col>2</xdr:col>
              <xdr:colOff>238125</xdr:colOff>
              <xdr:row>5</xdr:row>
              <xdr:rowOff>9525</xdr:rowOff>
            </to>
          </anchor>
        </controlPr>
      </control>
    </mc:Choice>
    <mc:Fallback>
      <control r:id="rId2" name="CheckBox2" shapeId="1"/>
    </mc:Fallback>
  </mc:AlternateContent>
  <mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <mc:Choice Requires="x14">
      <control r:id="rId4" name="CheckBox4" shapeId="2">
        <controlPr r:id="rId4" autoLine="0" defaultSize="0">
          <anchor>
            <from>
              <xdr:col>2</xdr:col>
              <xdr:colOff>66675</xdr:colOff>
              <xdr:row>5</xdr:row>
              <xdr:rowOff>9525</xdr:rowOff>
            </from>
            <to>
              <xdr:col>2</xdr:col>
              <xdr:colOff>238125</xdr:colOff>
              <xdr:row>6</xdr:row>
              <xdr:rowOff>0</xdr:rowOff>
            </to>
          </anchor>
        </controlPr>
      </control>
    </mc:Choice>
    <mc:Fallback>
      <control r:id="rId2" name="CheckBox2" shapeId="1"/>
    </mc:Fallback>
  </mc:AlternateContent>
</controls>

So the format is changed and it seems like excel 2007 isn´t able to handle that correctly.

Another side fact: Opening the original document with excel 2007 works, but after saving this to an xlsx, those checkboxes got fully removed from the structure, so I mostly assume there either was a bug in excel 2007 or some weird error in the document itself, which was an xls file before.

I attached you original.xml which represents the sheet1 in the document we got from our customer, aspose.xml which is after opening and saving with aspose and 2007.xml which was opening and saving with excel 2007.
sheets.zip (11.5 KB)

I am aware that there is a chance this is not a bug in Aspose itself. I am also aware that excel 2007 meanwhile is eol, so we also recommended an office update to our customers. I just want to provide those information to you in the case you plan to do deeper analysis into this.

Kind Regards,
Daniel

@Serraniel

Thanks for using Aspose APIs.

Sometime, due to some bug, controls are converted into pictures. So, it is necessary for you to test the issue with the most recent version because this issue has already been fixed. Let us know your feedback.

The most recent version can be downloaded from the following link.