Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim bs As String
Dim n As Integer
Dim i As Integer
Dim R As String
Dim App As New MSExcel.Application
App.Visible = False
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(dlg.FileName)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
n = Tables("数据管理").Rows.Count
For i = 0 To n-1
bs = "[" & Tables("数据管理").Rows(i)("唯一标识") & "]"
R = Ws.UsedRange.Find(What:= bs).Row
messagebox.show(R)
Next
Wb.Close
App.Quit
messagebox.show("导入成功!","提示")
End If