excel4node icon indicating copy to clipboard operation
excel4node copied to clipboard

Unable to add an img and cell comment on the same worksheet.

Open AdrianEunoia opened this issue 5 years ago • 1 comments

We have been testing to add an img and a cell comment on the same worksheet, individually it works perfectly but both makes the xlsx break.

Simple code example: var xl = require('excel4node');

var wb = new xl.Workbook(); var ws = wb.addWorksheet('Sheet 1');

// Cell + comment ws.cell(1, 1).number(100)//.comment("Comment"); // Img ws.addImage({ path: './descarga.jpg', type: 'picture', position: { type: 'oneCellAnchor', from: { col: 10, colOff: '0.5in', row: 10, rowOff: 0, }, }, }); wb.write('Excel.xlsx');

Thanks for your attention

AdrianEunoia avatar Sep 06 '19 07:09 AdrianEunoia

I can reproduce it too with excel files created in our own templates:

        ws.addImage({
            image: logo,
            type: "picture",
            position: {
                type: "twoCellAnchor",
                from: {
                    col: 1,
                    colOff: 0,
                    row: 2,
                    rowOff: 0,
                },
                to: {
                    col: 3,
                    colOff: 0,
                    row: 4,
                    rowOff: 0,
                },
            },
        });

ws.cell(row, column).comment(description, {
    height: "100pt",
    width: "160pt",
});

Error for debug:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  <logFileName>error189200_01.xml</logFileName>
  <summary>Errors were detected in file 'D:\Downloads\original.xlsx'</summary>
  <additionalInfo>
    <info>Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.</info>
  </additionalInfo>
  <removedParts>
    <removedPart>Replaced Part: /xl/worksheets/sheet1.xml part with XML error.  Load error. Line 1, column 0.</removedPart>
  </removedParts>
</recoveryLog>

SferaDev avatar Apr 27 '20 08:04 SferaDev