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 }
勤劳一日,便得一夜安眠;勤劳一生,便得幸福长眠。