- About styling:
This one should work properly:
row2.getCell(23).style = {font:{color: {argb: "004e47cc"}}}
Because, as a default all cells in a row referencing into one style
object and the font
is only a getter and setter to .style.font
- About accessing into worksheet:
Use "getWorksheet('sheetName')" instead of "getWorksheet(sheetNo)", This works fine for me.
So, in exceljs we provide two ways to get worksheet:
// FIRST:
// wb.getWorksheet(ws:string|number):Worksheet
wb.getWorksheet('sheetName')
wb.getWorksheet(sheetId)
// NOTE: sheetId is number written into worksheet,
// it's not a index in array - just a number from Excel.
// So for some files you read sheetId may be for instance: 10, 9, 999
// I recommend to avoid using ws.getWorksheet(NUMBER).
// SECOND:
// wb.worksheets: Array<Worksheet>
wb.worksheets[1];
wb.worksheets[2];
wb.worksheets[wb.worksheets.lenght-1];
// I am big fan of using this way :)