Thanks for the message. It worked. I put it in the following location. I did not set it to true and the end because this database will not be monitored, only the results.
Private Sub Command1_GotFocus()
Dim i As Integer
Dim objExcel
Dim objWorkBook
Set objExcel =...
You can also set up a windows task to open the database when you want it. The you can setup an AutoExec macro in access to execute the code when it opens and close the database when complete. I am doing something very similar and this process works well for me.
I have access transfer data from a table to a spreadhseet in excel. Then it opens the spreadsheet and performs some updates. Then I want to save it and close it. This process is executed from a Windows task scheduler so noone is physically is in the database and can check any buttons. Excel...