导出后用MSExcel.Application
如
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fname)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(sname)
Dim Rg As MSExcel.Range = Ws.Range("A1") '以这个指定的单元格为基准
Rg.EntireRow.Insert(MSExcel.XlInsertShiftDirection.xlShiftDown)'在基准单元格上面插入一行
'App.Visible = True
Rg = Ws.Range("A1:o1")
App.DisplayAlerts = False '加上此行可禁止弹出合并前的提示
Rg.Merge '合并指定区域的单元格
Rg.HorizontalAlignment = MSExcel.Constants.xlCenter '水平居中
Rg.VerticalAlignment = MSExcel.Constants.xlCenter '垂直居中
With Rg.Font
.Name = "黑体" '字体
.Size = 20 '字号
.Bold = True
End With
Rg.RowHeight = 40 '行高40磅
Rg.Value = "这是标题"
Wb.Save
App.Quit