Skip to content

Corrupted file with AlternateContent #1196

@jackson-bleechmore

Description

@jackson-bleechmore

Hi there,

I have a file with an AlternateContent section in the worksheet XML, which is related to a Developer button.

When this is opened/written to a file (without making any changes) by Excelize commit d9b5afc, it cannot be opened by Excel (v16.59, macOS 12.1) (button_d9b5afc1ac4e.xlsx).

However, when doing the same thing with the Excelize released version (2.5.0) the file is not corrupted, and opens fine (button_2.5.0.xlsx).

When comparing the 2 outputted files XML worksheets the only difference is the file created using d9b5afc commit has the AlternateContent section preserved at the end of the file.

The original file (button.xlsx) has the AlternateContent section midway through.

Sounds like what was implemented in this commit f0cb29c

See the AlternateContent XML section below:
<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"> <mc:Choice Requires="x14"> <controls> <mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"> <mc:Choice Requires="x14"> <control shapeId="1025" r:id="rId4" name="Button 1"> <controlPr defaultSize="0" print="0" autoFill="0" autoPict="0"> <anchor moveWithCells="1" sizeWithCells="1"> <from> <xdr:col>0</xdr:col> <xdr:colOff>635000</xdr:colOff> <xdr:row>0</xdr:row> <xdr:rowOff>25400</xdr:rowOff> </from> <to> <xdr:col>2</xdr:col> <xdr:colOff>12700</xdr:colOff> <xdr:row>0</xdr:row> <xdr:rowOff>215900</xdr:rowOff> </to> </anchor> </controlPr> </control> </mc:Choice> </mc:AlternateContent> </controls> </mc:Choice> </mc:AlternateContent>

Thanks in advance for your help, hopefully this can be fixed so we can make use of some of the new features implemented.

Cheers,
Jackson

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedThis issue can be reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions