Skip to content

Instantly share code, notes, and snippets.

@natergj
Created October 19, 2018 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save natergj/40b7dc4eed9fc0ab3e5a76f8d79f5adc to your computer and use it in GitHub Desktop.
Save natergj/40b7dc4eed9fc0ab3e5a76f8d79f5adc to your computer and use it in GitHub Desktop.
Freeze 1st row on 2nd sheet only
const xl = require('excel4node')
const wb = new xl.Workbook()
const ws1 = wb.addWorksheet('sheet 1')
ws1.cell(1, 1).string('Sheet 1 - A1')
ws1.cell(5, 1).string('Sheet 1 - A5')
ws2 = wb.addWorksheet('sheet 2')
ws2.cell(1, 1).string('Sheet 2 - A1')
ws2.cell(1, 5).string('Sheet 2 - A5')
ws2.row(1).freeze()
wb.write('Freeze.xlsx')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment