Hello and thank you for your time, I scraped together some VBA code that imports several Access tables into Excel. The code works perfectly, it loads 12 worksheets with the contents of 12 tables. It does not matter if the MDB is open or closed, the code works either way (nice!). After I run the code, the MDB opens in read only mode. If I close the Excel workbook (which is host to the macro) then the MDB opens normally. Here's my question: How can I close the ODBC link (with VBA) without closing the Excel workbook? Below is an except of the code I scraped together with the help of the macro recorder (code between EZ3) and code that a co workhed provided (see code between EZ2).
Any help would be greatly appreciated. Below is an except of code used to establish ODBC connection and to load a worksheet.
Bookmarks