如何在VB中正确将调用的Excel进程关闭?
我在程序中调用了Excel进行数据处理,但是数据处理后无法将调用的Excel关闭,这是为什么?
Dim OutPutExcel As Object
Dim MainBook As Excel.Workbook
Const ClassObject = "Excel.Application"
Set OutPutExcel = CreateObject(ClassObject)
Set MainBook = OutPutExcel.Workbooks.Open(App.Path & "\" & "ExportWizard.xls")
......
MainBook.SaveAs SaveFile
MainBook.Close
OutPutExcel.Quit
Set OutPutExcel = Nothing
Set MainBook = Nothing
Set MainSheet = Nothing