Import Excel data into Access

G

George

I'm using this logic to import Excel data into Access.

Public Sub ImportProtected(strFile As String, strPassword As String)
Dim oExcel As Object, oWb As Object

Set oExcel = CreateObject("Excel.Application")
Set oWb = oExcel.Workbooks.Open(FileName:=strFile, _
Password:=strPassword)
DoCmd.TransferSpreadsheet acImport, _
acSpreadsheetTypeExcel9, "Import", strFile, -1
oWb.Close
oExcel.Quit
Set oExcel = Nothing
End Sub

It works great but it leaves an instance open of Excel in my task list.
Can someone tell me what is wong with this logic and why it is not actually
exiting Excel?



Expand AllCollapse All
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top