Deletes a query table
30/06/2015 § Leave a comment
Dim qt As QueryTable
For Each qt In ActiveSheet.QueryTables
If qt.Refreshing Then qt.CancelRefresh
Deletes a query table. If the query table is refreshing asynchronously,
Delete causes an error. Deleting a query table does not remove data from cells on a worksheet—it just removes the ability to refresh those cells from their data source.
The following code deletes all of the query tables on the active worksheet and clears their data: