ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get external data by dynamical url - no update (https://www.excelbanter.com/excel-programming/371589-get-external-data-dynamical-url-no-update.html)

drofluga

Get external data by dynamical url - no update
 
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


drofluga

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



R..VENKATARAMAN

Get external data by dynamical url - no update
 
can you not try an event code like
worksheet_change.
so that if the target value is changed the corresponding url is opened.


"drofluga" wrote in message
ps.com...
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





drofluga

Get external data by dynamical url - no update
 
Thanks for you idea, but the URL is always correct. Excel only doesnt
put the data into the sheet when i change the url.

regards,

R..VENKATARAMAN schrieb:

can you not try an event code like
worksheet_change.
so that if the target value is changed the corresponding url is opened.


"drofluga" wrote in message
ps.com...
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





All times are GMT +1. The time now is 12:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com