Thread: Stock Quotes
View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Stock Quotes

The code I posted earlier uses the MSN Stock quote addin in the normal way
of adding a function as a cell formula. It also references the addin's "dll"
to use the same functions directly in VBA. Both methods give identical
results and that is to be expected.

On reading your OP I assumed when you said you were getting values with VBA
you meant the same way as I posted, later your code clarified you were doing
a web query, in effect getting the details from this address

http://moneycentral.msn.com/investor...?SYMBOL=AU:AZZ

All the prices in this link are shown to 2dp with the AZZ ticker, if you go
to the main moneycentral site you will get same.

As for the 10dp my debug result return, I don't think the additional dp are
meaningful, I suspect the result of some rounding not ending up as the
intended 2dp.

Looks like prices for your AZZ are sometimes in 0.5 cent (Aus) increments,
try this in a browser then as a web query:

http://finance.yahoo.com/q?s=AZZ.AX
(or similar local link)

It'd be easy enough to adapt this source to your needs.

Regards,
Peter T





"Ken G" wrote in message
...
In one of your earlier posts in this thread you had some code that
retrieved
about 10 decimal places in a debugging routine. How does that work?
I should have made it clearer that I'm only retrieving the Company Name
and
the Last Price because that was part of the modification I did to the
original code to suit what I needed for the particular application.

I still think its odd that if I use the add-in, remove the option to
retain
formatting, and format my target cell to 3 decimal places, that it will
correctly retrieve 3 decimal places, presumably from the same MoneyCentral
source as is used in the code.

"Peter T" wrote:

I added a standard "New Web Query" to a new sheet based on this address

http://moneycentral.msn.com/investor...?SYMBOL=AU:AZZ

As you say it only returns 2dp with AU:AZZ, nothing you can do in Excel
to
improve that, Dim'ing with double won't help. Maybe you can find a
different
site that will give you more. I understand Yahoo Finance is pretty good
with
web queries.

All I'm retrieving is the Company name and last price.


That's because you are only getting name and last-price from the query
sheet,
rngLookUpSym.Range("B1") = rngQuerySymCo
rngLookUpSym.Range("G1") = rngQuerySymData.Value