excel-templates
excel-templates copied to clipboard
Merged cells not expanding properly
If a merged cell is contained in a row of the template Excel file, and that row is replaced by more than one row, the resulting Excel file only carries the merge over for the original row.
So if row 22 has a merged cells, and it is replaced by 3 rows, then row 22 in the new file will still contain the merged cells but rows 23 and 24 will not.
It looks like merged cell info is stored in the worksheet (eg. "sheet1.xml") in the <mergeCells> tag under the
There is a count attribute that has to be updated as well.
<mergeCells count="4"> <mergeCell ref="A38:G38"/> <mergeCell ref="A39:G39"/> <mergeCell ref="A40:G40"/> <mergeCell ref="A32:G32"/> </mergeCells>
Reference on page 1639 of ECMA-376, 4th Edition, Office Open XML File Formats — Fundamentals and Markup Language Reference.