marioubillus
New Member
- Joined
- Feb 4, 2014
- Messages
- 4
Hi all,
I have <acronym>vba</acronym> code for retriveing historical exchange rates is no longer working (used to work OK a couple of months ago) and can't figure out why.
Here is the part of the code that has the query:
------------------------------
curr = "PEN"
qurl = "http://www.oanda.com/lang/es/currency/historical-rates-classic?date_fmt=normal&date=" & EndDate & "&date1=" & StartDate & "&exch=USD&exch2=USD" & "&expr=" & curr & "&expr2=" & curr & "&margin_fixed=0&format=HTLM&redirected=1"
QueryQuote:
With Sheets("TC").QueryTables.Add(Connection:="URL;" & qurl, Destination:=Sheets("TC").Range("E1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
---------------------------
The resulting qurl value (http://www.oanda.com/lang/es/curren...2=PEN&margin_fixed=0&format=HTLM&redirected=1) works OK (displays the data I need, so no date formatting issues).
The problem is with retrieving and pasting the data into Excel
Thanks in advance for any help
I have <acronym>vba</acronym> code for retriveing historical exchange rates is no longer working (used to work OK a couple of months ago) and can't figure out why.
Here is the part of the code that has the query:
------------------------------
curr = "PEN"
qurl = "http://www.oanda.com/lang/es/currency/historical-rates-classic?date_fmt=normal&date=" & EndDate & "&date1=" & StartDate & "&exch=USD&exch2=USD" & "&expr=" & curr & "&expr2=" & curr & "&margin_fixed=0&format=HTLM&redirected=1"
QueryQuote:
With Sheets("TC").QueryTables.Add(Connection:="URL;" & qurl, Destination:=Sheets("TC").Range("E1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
---------------------------
The resulting qurl value (http://www.oanda.com/lang/es/curren...2=PEN&margin_fixed=0&format=HTLM&redirected=1) works OK (displays the data I need, so no date formatting issues).
The problem is with retrieving and pasting the data into Excel
Thanks in advance for any help
Last edited: