Sub LinkExcel(ExcelApp)
On Error Resume Next
Set ExcelApp = GetObject(, "Excel.application")
If Err Then
Err.Clear
Set ExcelApp = CreateObject("Excel.application")
If Err Then
MsgBox ("不能运行Excel,请检查是否安装了Excel")
Exit Sub
End If
ExcelApp.Application.Visible = True
ExcelApp.Workbooks.Add
End If
ExcelApp.StatusBar = "Ready"
End Sub