Can't get excel to close from task manager

T

ThunderTek

Excel will not close. I have to load an Add-In, open a workbook, transfer
data into Access, close and save excel.....all without the user knowing that
excel even opened. Here is my code: (I need to get excel to dump off and I
need an autosave line before closing the excel sheet.) I also get an error
message for an ActiveX control that I do not use......please help.

Dim objXL As Object
Set objXL = CreateObject("Excel.Application")

objXL.Workbooks.Open (objXL.LibraryPath & "\AtData.XLA") '.RunAutoMacros 1
objXL.Workbooks.Open "C:\AlkyLabData.xls"
objXL.Visible = False
DoCmd.TransferSpreadsheet , , "TestingImportData2", "C:\AlkyLabData.xls", True

Me.Requery
DoCmd.GoToRecord , , acLast
objXL.Quit
Set objXL = Nothing
 

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