Quote Originally Posted by johnywhy View Post
But we know, from those phantom workbooks which remain open in the VBA project explorer, that you still need to set the variable to Nothing. End Sub isn't enough.
Where have you read that?
If I create a new workbook then close it again straightaway (while I have the VBE open), it appears in the project explorer and remains there. How does that indicate there are uncleared objects in that workbook (especially as I haven't written any code in that workbook)?

Separately, regarding your main questions in your first post in this thread; Is the emphasis on being able to use SQL to query an Excel table in another (open) workbook, or to bring the data into VBA? I ask because Power Query (aka Get & Transform data) has been built-in to Excel since version 2016 (so it's no longer an add-in (it's now what you're calling a core feature), so no extra-overhead). Power Query brings data in from Excel tables in its stride, isn't limited to the number of rows on a sheet, can be 'connection-only' and is possibly more powerful and easy to use than pure sql with vba, especially since the PQ Editor previews the steps as you go along. I think there's very little transformation/filtering that you can do in SQL that you can't do in Power Query.
Why don't you tell us the kinds of things you want to do with the data, to see whether it can be done easily with PQ?
Often, PQ transformations will be folded into SQL (though I recognise that an expert sql coder will likely still be able to produce more efficient code then machine-produced sql code).