/ Published in: Visual Basic

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
' Gets current exchange rate for Canadian dollar ' ' Code Source: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=689249&SiteID=1 ' Data Source: http://finance.yahoo.com/q?s=USDCAD=X ' Function getExchangeRate() As String Dim HttpReq As New MSXML2.XMLHTTP40 Dim url, arr, delim, resp As String delim = "," url = "http://download.finance.yahoo.com/d/quotes.csv?s=USDCAD=X&f=sl1d1t1c1ohgv&e=.csv" HttpReq.Open "GET", url, False HttpReq.send resp = HttpReq.responseText arr = Split(resp, delim) getExchangeRate = arr(1) End Function
Comments
