① 如何用vb关闭已经打开的excel文件
DimWbAsWorkbook
SetWb=GetObject(ThisWorkbook.Path&"Sorterlist1.xls")
Wb.CloseFalse
② VB编程打开和关闭EXCEL文件
Dim EApp As Object‘定义一个全局变量
Private Sub CommandButton1_Click()'打开
Set EApp = CreateObject("Excel.Application")
EApp.Visible = True
End Sub
Private Sub CommandButton2_Click()'关闭
If Not EApp Is Nothing Then
EApp.Quit
End If
End Sub