我这有个datagridview的,你可以参考一下
private void ToExcel(DataGridview dataGridView1)
Excel.Application xlApp = new Excel.Application();
            Excel.Workbooks workbooks = xlApp.Workbooks;
            Excel.Workbook workbook = workbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet);
            Excel.Worksheet worksheet = (Excel.Worksheet)workbook.Worksheets[1];//取得sheet1            try
            {
                //写标题,这里就是你想要的
                Excel.Range range = worksheet.get_Range("A1:G1", Type.Missing);
                range.Merge(Type.Missing);
                range.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
                range.FormulaR1C1 = "建三江税务表";
                range.Font.Size = 14;
                range.Font.FontStyle = "Bold";                // 写字段名
                for (int i = 0; i < dataGridView1.Columns.Count; i++)
                {
                    worksheet.Cells[2, i + 1] = dataGridView1.Columns[i].HeaderText.ToString();
                }                // 写记录
                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    for (int j = 0; j < dataGridView1.Columns.Count; j++)
                    {
                        worksheet.Cells[i + 3, j + 1] = dataGridView1.Rows[i].Cells[j].Value.ToString(); ;
                    }
                }                worksheet.Columns.EntireColumn.AutoFit();//自动适应每列的宽度 
                Excel.Range rg = worksheet.get_Range(worksheet.Cells[2, 1], worksheet.Cells[2, dataGridView1.Columns.Count]);
                rg.Font.Bold = true;
                workbook.Saved = true;
                workbook.SaveCopyAs(@"F:\新建 Microsoft Excel 工作表.xls");                // 关掉内存中的进程
                xlApp.Quit();
                MessageBox.Show("导入成功!");
                
                System.Diagnostics.Process.Start(@"F:\新建 Microsoft Excel 工作表.xls");
            }
            catch (Exception ex)
            {
                throw ex;
            }