首先引用Excel:【工具】→【引用】 查找到Microsoft Excel 选中引用
Public Sub ReadSource()
'声明Excel相关
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Set xlApp = New Excel.Application
'获取指定excel文件
Set xlBook = xlApp.Workbooks.Open("C:\test.xls")
Dim sheet As Excel.Worksheet
'获取指定sheet
Set sheet = xlBook.Worksheets(2)
Dim ss As String
'获取指定单元格的内容
ss = sheet.Cells(2, 2)
'内容显示
MsgBox (ss)
End Sub