Return to Snippet

Revision: 4167
at October 30, 2007 15:10 by corydeppen


Initial Code
' 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

Initial URL

                                

Initial Description

                                

Initial Title
Get Currency Exchange Rate

Initial Tags

                                

Initial Language
Visual Basic