I have a Excel I am trying to create with specific format. So my last column I have formatted for currency.
IStyle dollarStyle = workbook.Styles.Add("DollarStyle");
dollarStyle.NumberFormat = "$#,##0.00";
worksheet.SetDefaultColumnStyle(7, dollarStyle);
But I formatted a few rows in the header section for a specific format
IStyle tableHeaderStyle = workbook.Styles.Add("TableHeaderStyle");
tableHeaderStyle.Font.Bold = true;
tableHeaderStyle.Color = System.Drawing.Color.LightGray;
tableHeaderStyle.Borders[ExcelBordersIndex.EdgeBottom].LineStyle = ExcelLineStyle.Thin;
worksheet.Range["A8:G8"].CellStyle = tableHeaderStyle;
The problem is the colum format over rides the row format. I have tried changing order but no success.
Is there a way to start the column format at row 8?