On Nov 15, 2:40*pm, Fidel wrote:
Hey guys,
Was wondering if anyone knew how to load a webpage into memory and
pull a specific quote using a function.
For example I would want to write a function *=BBQuote(CLLRUIB,LX) or
=BBQuote(CSCOMPU,SW)
to get the NAV from these webpages
http://www.bloomberg.com/apps/quote?...r=CSCOMPU%3ASW
Fidel...This is fast (good if you're doing a lot of these) and
simple...Ron
Sub quotes()
my_url = "http://www.bloomberg.com/apps/quote?ticker=CLLRUIB%3ALX"
Set my_obj = CreateObject("MSXML2.XMLHTTP")
my_obj.Open "GET", my_url, False
my_obj.send
my_var = my_obj.responsetext
Set my_obj = Nothing
pos_1 = InStr(1, my_var, "QuoteTableData", vbTextCompare)
pos_2 = InStr(pos_1, my_var, "", vbTextCompare)
pos_3 = InStr(pos_2, my_var, "<", vbTextCompare)
my_NAV = Mid(my_var, 1 + pos_2, pos_3 - (1 + pos_2))
' now do what you want with my_NAV
End Sub