一、打开Excel
Dim ExcelApp As Excel.Application
Dim ExcelBook As Excel.Workbook
Dim ExcelSheet As Excel.Worksheet
Set ExcelApp = CreateObject("Excel.Application")
Set ExcelBook = ExcelApp.Workbooks.Add
ExcelFilePath = Application.ActivePresentation.Path & "\" & "ExcelFileName"
'使用相对路径要比绝对路径好
ExcelApp.Workbooks.Open ExcelFilePath, ReadOnly:=False
Set ExcelBook = ExcelApp.Workbooks("ExcelFileName")
Set ExcelSheet = Excel.Worksheets(n)
'(n=1...工作表)
二、关闭Excel
If Not (ExcelBook Is Nothing) Then ExcelBook.Close
If Not (ExcelApp Is Nothing) Then ExcelApp.Quit
Set ExcelBook = Nothing
Set ExcelSheet = Nothing
Set ExcelApp = Nothing