Skip to content

Instantly share code, notes, and snippets.

@natergj
Created January 15, 2018 15:41
Show Gist options
  • Save natergj/585a6c7624678dc93abd9d6eba2b1b32 to your computer and use it in GitHub Desktop.
Save natergj/585a6c7624678dc93abd9d6eba2b1b32 to your computer and use it in GitHub Desktop.
Attempt to recreate the behavior described in https://github.com/natergj/excel4node/issues/161
const xl = require('excel4node');
const wb = new xl.Workbook();
const ws = wb.addWorksheet('sheet1');
const ws2 = wb.addWorksheet('sheet2');
ws2.cell(1,1).string('value 1');
ws2.cell(2,1).string('value 2');
ws2.cell(3,1).string('value 3');
ws.addDataValidation({ type: 'list', sqref: 'A2:'+'A20', formulas: [ '=sheet2!$A$1:$A$3' ] });
wb.write('DataValidationTest.xlsx');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment