Stuart McLachlan
stuart at lexacorp.com.pg
Sat Jun 30 06:40:31 CDT 2012
I decided to play as well :-)
Function GetExchRate(strCurr As String) As String
'VBA code to retrieve exchange rate against Euro
'strCurr should be the three letter currency code
Dim oHTTP As Object
Dim lngresult As Long
Dim strPage As String
strCurr = UCase$(strCurr)
Set oHTTP = CreateObject("Msxml2.XMLHTTP")
lngresult = oHTTP.Open("GET", "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml")
lngresult = oHTTP.Send("")
strPage = oHTTP.Responsetext
Set oHTTP = Nothing
lngresult = InStr(strPage, "currency='" & strCurr & "'")
GetExchRate = "EUR/" & strCurr & " => " & Val(Mid$(strPage, lngresult + 21))
End Function
On 29 Jun 2012 at 22:58, Mark Simms wrote:
> > Do you see many differences with VBA?
>
> Extreme verbosity....not elegant at all.
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>