Skip to content

Error: Worksheet name already exists: My Sheet #910

Open
@useralive003

Description

@useralive003

Error: Worksheet name already exists: My Sheet

var Excel = require('exceljs');

function test(invoices) {

var workbook = new Excel.Workbook();

var worksheet = workbook.addWorksheet('My Sheet');

worksheet.getRow(1).font = { bold: true };
worksheet.getRow(1).alignment = { horizontal: 'center', vertical: 'middle', wrapText: true };
worksheet.getColumn('B').alignment = { horizontal: 'center' };
worksheet.getCell('A1').value = 'Invoice Number';
worksheet.getCell('B1').value = 'Invoice Total';
worksheet.getColumn('A').width = 15;
worksheet.getColumn('B').width = 10;

 for (var i = 0; i < invoices.length; i++) {

    worksheet.getCell('A' + (i + 2)).value = invoices[i].InvoiceNumber;

    worksheet.getCell('D' + (i + 2)).value = invoices[i].InvoiceTotal;



}

return workbook;

}

It's working on ExcelJS version 10.0.0 but when update to new version of ExcelJS (1.14.0) getting this error

Node version : 12.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy