Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Charlie Miller   on Feb 08 In MS Office Category.

  
Question Answered By: Tyler Thompson   on Feb 08

I am using the import  data query  to bring in 4 .wk1 files which are
constantly being replaced (with same file names) by another program.
The problem is that the query locks the source file preventing
replacement so I must eliminate the query after import and before
the files can be updated again.

I found this on another message board and it works great:

Sub Removequeries()
Dim ws As Worksheet
Dim qt As QueryTable
For Each ws In ThisWorkbook.Worksheets
For Each qt In ws.QueryTables
qt.Delete
Next qt
Next ws
End Sub

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Save Query Definitions Or get search suggestion and latest updates.


Tagged: