在vb.net中整合excel数据

时间:2015-05-06 11:33:52

标签: vb.net excel

使用vb.net合并数据时出错。请帮忙。

Imports Microsoft.Office.Interop
Public Class Form1
    Dim xlsWorkSheet As Excel.Worksheet
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim xlsApp As New Excel.Application
    xlsApp.Visible = True
    Dim xlsWorkbook As Excel.Workbook = xlsApp.Workbooks.Open("C:\Users\hwai\Desktop\Consolidate.xlsx")
    lsWorkSheet.Range("H1").Select().Consolidate("'C:\Users\hwai\Desktop\[Consolidate.xlsx]Sheet1'!A1:B8", _Function:=-4112, TopRow:=False, LeftColumn:=True, CreateLinks:=False)
End Sub

任何帮助表示感谢。

0 个答案:

没有答案