View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Alarmbloke
 
Posts: n/a
Default How to do automatic Web Queries??

Hi,

I would like to be able to import data automatically from a web page without
having to type in the web address.

I can create the correct url path in a cell using a CONCATENATE function but
cannot create a macro which references to that cell for the url look up.

This is the macro as it currently stands


With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.************************", _
Destination:=Range("a1"))
.Name = "main.php?cid=5516"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False

I would like this part ie With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.************************", _
Destination:=Range("a1"))
to use an url from a cell rather than a fixed link

Sorry if I have descibed this problem poorly.