Glory
Well-known Member
- Joined
- Mar 16, 2011
- Messages
- 640
When I clear the range that holds query table "MyTable", the table vanishes. If I delete the name reference in ThisWorkbook.Names, then there's nothing left of the query table...
Or is there?
When I try to create another table with the same name:
The name of the table is automatically appended with a "_1", like: "MyTable_1".
This behavior can be avoided if the workbook is closed and reopened before the new table is created. That solution doesn't help at all if I'm trying to create a button that will delete broken tables and reproduce them with the same name to preserve ADO functionality.
How can I really delete a query table?
Or is there?
When I try to create another table with the same name:
Code:
With .QueryTables.Add(Connection:="URL;" & a1 & b5, Destination:=b3.Range("A1"))
.AdjustColumnWidth = False
.FieldNames = False
.BackgroundQuery = True
.Name = "[COLOR=red]MyTable[/COLOR]"
.RowNumbers = False
.WebFormatting = xlWebFormattingNone
.WebSelectionType = xlSpecifiedTables
.WebTables = "3"
.Refresh BackgroundQuery:=False
End With
The name of the table is automatically appended with a "_1", like: "MyTable_1".
This behavior can be avoided if the workbook is closed and reopened before the new table is created. That solution doesn't help at all if I'm trying to create a button that will delete broken tables and reproduce them with the same name to preserve ADO functionality.
How can I really delete a query table?