Search code examples
javascriptnode.jsexceljs

Insert a column in exceljs


I have an existing xlsx file, with 4 columns. [ A, B, C, D ]. I want to insert a new column between A and B to have => [A, B, C, D, E] where B is new and C, D, E are the old [B, C, D]. I haven't found a method in the doc page

Doc : https://github.com/exceljs/exceljs


Solution

  • I found the method called "spliceColumns". It works perfectly. For my example => workbook.spliceColumns(2, 0, [])