From a post I had yesterday I had added in a linked Excel table into my Access Database (Thanks Skip). The data in the Excel file is based off a query that runs each time it is opened.
When I run the Excel file by itself it works fine, and closes fine. When I view it through Access without the Excel file open everything is fine. My problem comes up when I open the Excel file and view the table in Access. If I close either or both files there is always an instance of Excel running in the background.
This creates a few problems, obviously there is additional memory being used, as well as if the user tries to reopen the file it breaks, and states that the query has lost its connection to the database.
I can have the instance removed through Access VBA by doing your basic .quit and set = nothing, but I would like the vba in Excel so that when it closes it removes this instance, just in case the file is accidentally closed, it can be reopened without problems. I have tried adding the quit set = to nothing lines of code to the Excel, but when the quit runs the rest of the code can not be completed.
Any help would be greatly appreciated.
Aren
When I run the Excel file by itself it works fine, and closes fine. When I view it through Access without the Excel file open everything is fine. My problem comes up when I open the Excel file and view the table in Access. If I close either or both files there is always an instance of Excel running in the background.
This creates a few problems, obviously there is additional memory being used, as well as if the user tries to reopen the file it breaks, and states that the query has lost its connection to the database.
I can have the instance removed through Access VBA by doing your basic .quit and set = nothing, but I would like the vba in Excel so that when it closes it removes this instance, just in case the file is accidentally closed, it can be reopened without problems. I have tried adding the quit set = to nothing lines of code to the Excel, but when the quit runs the rest of the code can not be completed.
Any help would be greatly appreciated.
Aren