webquery function - don't save query in macro

A

a spijkman

Hi all,

I am using since a while the webquery possibility. The thing I can't fix is
the following:
I use the macrorecorder to record my functions, to process the same later.
My first step: start recording
My second step" Data > External Data > New Web Query...
search my webpage and enable the part I want to have in Excel and click
Import
until now nothing special
My third step: In the Import Data screen, I click on the Properties button
and disable the Save Query definition and click OK and OK again to get my
data into Excel.
Fourth step: stop the macrorecorder
The result is my downloaded data is normal data without any link to an
external source. That's what I want.
But... The macrorecorder gives the following:
Sub Macro1()
With
ActiveSheet.QueryTables.Add(Connection:="URL;http://www.example.com" _
, Destination:=Range("A1"))
.Name = "www.example.com"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "3"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Range("A1").Select
End Sub

As shown: .SaveData = True was not what I selected and not what I expected.
When I clear the data and run the macro, the data comes with a webquery
source, instead of without.
Even when I alter to .SaveData=False, there is no difference in the result.

What can I do with my macro, that I can get data without saving query
definitions in my data?

André
 
Top