I am trying to write a sub to delete all queries in a workbook. I have got the code below:
Dim CN As Variant
Dim qTable As QueryTable
For Each CN In ThisWorkbook.Connections
CN.Delete
Next CN
For Each qTable In Sheets("Property Extract 1").QueryTables
qTable.Delete
Next qTable'
The connection deletion works fine but the queries remain. Any ideas how to delete all queries in a workbook?
I was planning to replicate the query deletion for 2 or 3 sheets.
thanks