|
在access用DoCmd.TransferSpreadsheet多次导入excel文件后,在windows进程中会发现有多个excel进程在运行。怎样才可以释放这些内存占用,杀死进程?
Set xlApp = CreateObject("Excel.Application")
Set xlApp = New Excel.Application
xlApp.Visible = False
Set xlBook = xlApp.Workbooks.Open(fileName)
For Each xlSheet In xlBook.Worksheets
sheetName = xlSheet.Name
range = sheetName & "!a1:g100"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, sheetName, fileName, True, range
range = ""
Next xlSheet
Set xlSheet = Nothing
xlBook.Close (False)
'SaveChanges:=False
Set xlBook = Nothing
xlApp.Quit
Set xlApp = Nothing
另外DoCmd.TransferSpreadsheet可以导入整张sheet而不指定range吗?
|
|