Excel Interior.ColorIndex色彩列表

1 Microsoft.Office.Interop.Excel.Range range;
1  for (int i = 0; i < dt.Columns.Count; i++)
2         {
3             worksheet.Cells[1, i + 1] = dt.Columns[i].ColumnName;
4             range = (Microsoft.Office.Interop.Excel.Range)worksheet.Cells[1, i + 1];
5             //设置区域背景色
6             range.Interior.ColorIndex = 15;
7         }

 

posted @ 2015-11-25 18:22  赵孟蒙  Views(11178)  Comments(1Edit  收藏  举报