Excel 2016. I've been testing some VBA and a simple text import stopped working. I'd forgotten that despite including:
and verifying there were no queries or connections, there is in fact still an active query. Found by right clicking in a cell in the data range and checking the Data Range Properties that then reports the External Data Range Properties where a query is listed and a check box option for Save query definition that was checked by default.
Fortunately I have no holes in the first and last columns/rows of the text file I'm importing, so I'm able to use last row and last column to make a table I then copy and paste as values. That removes the query, copy and paste cells would probably work too.
But is there some VB that will change the Save query definition selection to False?
And my teeth clenching question "Who dreamed this up?"
TIA
Ron
VBA Code:
If ThisWs.QueryTables.Count > 0 Then
ThisWs.QueryTables(1).Delete
End If
If ThisWb.Connections.Count > 0 Then
ThisWb.Connections.Delete
End If
Fortunately I have no holes in the first and last columns/rows of the text file I'm importing, so I'm able to use last row and last column to make a table I then copy and paste as values. That removes the query, copy and paste cells would probably work too.
But is there some VB that will change the Save query definition selection to False?
And my teeth clenching question "Who dreamed this up?"
TIA
Ron