问题解决,谢谢蓝板
Dim tbl As Table = Tables("台账一")
Dim hdr As Integer = tbl.HeaderRows '获得表头的层数
Dim cnt As Integer
Dim Book As New XLS.Book
Dim Sheet As XLS.Sheet = Book.Sheets(0)
tbl.CreateSheetHeader(Sheet) '生成表头
For c As Integer = 0 To tbl.Cols.Count - 1
If tbl.Cols(c).Visible Then
For r As Integer = 0 To tbl.Rows.Count - 1
sheet(r + hdr,cnt).value = tbl(r,c)
Next
cnt = cnt + 1
End If
Next
Dim tbl1 As Table = Tables("台账二")
Dim hdr1 As Integer = tbl1.HeaderRows '获得表头的层数
Dim cnt1 As Integer
Book.Sheets.Add()
Dim Sheet1 As XLS.Sheet = Book.Sheets(1)
tbl1.CreateSheetHeader(Sheet1) '生成表头
For c1 As Integer = 0 To tbl1.Cols.Count - 1
If tbl1.Cols(c1).Visible Then
For r1 As Integer = 0 To tbl1.Rows.Count - 1
sheet1(r1 + hdr1,cnt1).value = tbl1(r1,c1)
Next
cnt1 = cnt1 + 1
End If
Next
Dim tbl2 As Table = Tables("台账三")
Dim hdr2 As Integer = tbl2.HeaderRows '获得表头的层数
Dim cnt2 As Integer
Book.Sheets.Add()
Dim Sheet2 As XLS.Sheet = Book.Sheets(2)
tbl2.CreateSheetHeader(Sheet2) '生成表头
For c2 As Integer = 0 To tbl2.Cols.Count - 1
If tbl2.Cols(c2).Visible Then
For r2 As Integer = 0 To tbl2.Rows.Count - 1
sheet2(r2 + hdr2,cnt2).value = tbl2(r2,c2)
Next
cnt2 = cnt2 + 1
End If
Next
Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog
dlg.Filter= "Excel文件|*.xls" '设置筛选器
dlg.FileName = "汇总台账"
If dlg.ShowDialog = DialogResult.Ok Then
Book.Save(dlg.FileName)
Dim Proc As New Process
Proc.File = dlg.FileName
Proc.Start()
End If