使用的类库是Microsoft.Office.Interop.Excel
Excel.Range range = xSheet.Range[xSheet.Cells[1, 1], xSheet.Cells[1, columnNum]];
//字体居中显示
range.HorizontalAlignment = Excel.XlVAlign.xlVAlignCenter;
//背景色为红色
range.Interior.Color = Color.FromArgb(255, 0, 0);
//字体颜色为白色
range.Font.Color = Color.FromArgb(255, 255, 255);