I just ran into the same problem that this Nabble user ran into when trying to apply a style to an Excel workbook using a non-rectangular set of rows and columns.
wb <- createWorkbook()
addWorksheet(wb, "Iris")
writeData(wb, sheet = 1, x = iris)
boldStyle <- createStyle(textDecoration=c("bold"))
addStyle(wb, 1, style = boldStyle, cols=4:5, rows = 1:150)
Error in addStyle(wb, 1, style = boldStyle, cols = 4:5, rows = 1:150, : Length of rows and cols must be equal.
How can I fix this code so that I don't get an error and so that I can apply the style to a non-rectangular set of cells?