I am currently using a form in Access (Office '03) to allow the user to import data from various Excel files. This is done using the TransferSpreadsheet method. However, after the data has been migrated an instance of Excel remains open. This becomes problematic when the user tries to use Excel for another purpose. Does anyone know of a way to completely close Excel using VBA? My code is currently as follows:
Thanks!
Code:
Set xl = New Excel.Application
xl.Dialogs(xlDialogFindFile).Show
strPath = xl.ActiveWorkbook.FullName
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, strTable, strPath, -1
xl.Quit
Set xl = Nothing
Thanks!