Code:
Dim Q as QueryTable
For Each Q in ActiveSheet.QueryTables
Q.Delete
Next
This code does not delete query table objects from the sheet. I know it's not working because I'm using a macro to delete old tables, and create new ones in their place with the same name.
Whenever the macro creates a new table, the new table's name looks like this: "Name_#", because the old tables are being plastered over with the new info.
I can also zoom out to 10% after running the code and see the old table, still present.
Is there another way to get rid of a querytable without just deleting the entire sheet?