View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
drofluga drofluga is offline
external usenet poster
 
Posts: 5
Default Get external data by dynamical url - no update

no ideas?


drofluga schrieb:

Hi there,

i have a problem to update my external data. I read a URL from the
Field B5 and then i try to connect to this URL and read my datas but
Excel doesnt update this data when i change the URL. I guess this
problem is related to the "import data" dialog in Excel, but i'm not
sure.

here is my code:


'Read the current URL
Sheets("Sheet1").Select
Dim zelle
zelle = "B5"
Dim wert
wert = Range(zelle).value

'update sheet
Sheets("Sheet2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & wert & "" _
, Destination:=Range("A1"))
.Name = "AlertUser"
.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 = _
"""Header_g_a134c740_e525_4177_bdd8_e384ed89782d_a lertstable"""
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With


I hope that anyone can help me.

Best Regards

Julian