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: Girja Garg   on Feb 08

I think it's to do with when you record a macro involving creating a
new web query, there is no difference in the code whether or not you
uncheck the option box 'Save query  Definition' (after the Import
button has been clicked an Import Data dialogue box appears which has
a Properties button which opens anopther dialogue box containing said
check box).

So if you run the recorded macro you end up with a saved query
regardless, as shown by a new defined Name and a refreshable query.

I found that if after
.Refresh BackgroundQuery:=False
I added the line
.Delete
just before the
End With
statement it semed to have the desired effect of having the data but
not having a refreshable query.

However I was ofttimes left with a Defined Name (only a range) in the
workbook which is removable with
ActiveSheet.Names("www.yourqueryname").Delete after the
End With
statement.
Obviously replace "www.yourqueryname" with whatever the query is named
in the line
.Name = "www.yourqueryname"

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: