Debes crear un estilo y asignarlo a un rango
Ejemplo
private Style GetStyleHeader(Workbook wb)
{
Style style = wb.Styles.Add("MiEstilo");
style.Font.Bold = true;
style.HorizontalAlignment = XlHAlign.xlHAlignCenter;
style.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red);
style.Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White);
return style;
}
Código completo:
private object[,] GetDataFromDGV(DataGridView dgv)
{
object[,] datos = new object[dataGridView1.Rows.Count + 1, dataGridView1.Columns.Count]; // +1 por la cabecera
for (int j = 0; j < dataGridView1.Columns.Count; j++)
{
datos[0, j] = dataGridView1.Columns[j].Name;
}
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
for (int j = 0; j < dataGridView1.Columns.Count; j++)
{
datos[i + 1, j] = dataGridView1.Rows[i].Cells[j].Value;
}
progressBar1.Value++;
}
return datos;
}
private Style GetStyleHeader(Workbook wb)
{
Style style = wb.Styles.Add("MiEstilo");
style.Font.Bold = true;
style.HorizontalAlignment = XlHAlign.xlHAlignCenter;
style.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red);
style.Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White);
return style;
}
private void button1_Click(object sender, EventArgs e)
{
Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
excel.Application.Workbooks.Add(true);
var datos = GetDataFromDGV(dataGridView1);
var style = GetStyleHeader(excel.Application.ActiveWorkbook);
excel.Range[excel.Cells[1, 1], excel.Cells[1, datos.GetLength(1)]].Style = style;
excel.Range[excel.Cells[1, 1], excel.Cells[datos.GetLength(0), datos.GetLength(1)]].Value = datos;
excel.Visible = true;
Worksheet worksheet = (Worksheet)excel.ActiveSheet;
worksheet.Activate();
}
Fuente: Documentación