1、生成不同的Excel报表,在复制到一个文件中,参考
1、在同一个Excel中合并:
Dim App As New MSExcel.Application
Dim Wb As MSExcel.Workbook = App.WorkBooks.open("f:\test.xls")
Dim ws As MSExcel.WorkSheet
ws = Wb.WorkSheets(1)
Dim rg As MSExcel.Range = ws.Cells(ws .UsedRange.Rows.Count+1,1)
app.DisplayAlerts = False
For i As Integer = Wb.WorkSheets.Count To 2 Step -1
Dim Ws2 As MSExcel.WorkSheet = Wb.WorkSheets(i)
Dim Rg2 As MSExcel.Range = Ws2.UsedRange
rg2.Copy
rg.PasteSpecial()
rg = ws.Cells(ws .UsedRange.Rows.Count+1,1)
Ws2.Delete
Next
Wb.Save
App.Quit
2、用专业报表做