关于Excel对象的释放问题:
二两就醉 2007-04-03 04:18:29 '
'办函数创建一个Excel文件
'strPath 是文件的路径
Public Function CreateExcelFile(strPath As String, iSheetCount As Integer)
Dim xls As New Excel.Application
Dim exlBook As New Excel.Workbook
Dim fso As New FileSystemObject
If fso.FileExists(strPath) Then fso.DeleteFile strPath
Set exlBook = xls.Workbooks.Add
exlBook.Worksheets.Add Count:=iSheetCount, After:=Sheets("Sheet3")
exlBook.SaveAs strPath
exlBook.Close
Set exlBook = Nothing
xls.Quit
Set xls = Nothing
Set fso = Nothing
End Function
打算创建一个Excel文件,其中包含了指定数目的工作表,操作已经成功。但是操作完成之后Excel对象没有释放,百思不得其解,求解!!!!
请帮忙调以上的代码,使其能完成同样的功能在函数完成时将Excel对象释放。