Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Help--excel not pulling stock prices

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Schultz - 11 Dec 2006 03:36 GMT
I use excel to pull quotes off of MSN Money (it comes with that option).

However, alot of quotes on obviously valid stocks (including ETFs) don't
come up.

For example, ticker IWD is the ishares russell 1000 value index.  EWW is the
ishares mexico index.

These come up fine anywhere I try to get a quote, but moneycentral.msm.com
acts like they don't exist!

Anyone know what gives?

Is there an easy way to quickly pull current (delayed is ok) quotes into
excel other than through the default microsoft moneycentral?

Thanks.
Dave Miller - 11 Dec 2006 17:57 GMT
Schultz,

-Put this code into a module ( making sure nothing is red after you
paste it! )
-Type your Ticker into Cell A1
-Type "=GetQuote(A1)" into Cell B1
-You should have your quote in B1

Code:
=======================================================
Option Explicit
Public Const URL As String = "http://finance.yahoo.com/q?s="
Function GetQuote(sTicker As String) As String
'=======================================================
'Fuction written by:  David Miller
'Returns a !Yahoo Finanace quote
'=======================================================
Dim ie As Object
Dim sHTML As String

On Error GoTo GetQuote_Err
Application.ScreenUpdating = False

Set ie = CreateObject("InternetExplorer.Application")

If IsNull(sTicker) Then GoTo GetQuote_Err

With ie
   .Visible = False
   .navigate (URL & sTicker)
   Do Until .readystate = 4
       DoEvents
   Loop
   sHTML = .document.body.innerHTML
   GetQuote = Mid(sHTML, InStr(sHTML, "yfs_l10_" & LCase(sTicker)) +
Len("yfs_l10_" & sTicker & Chr(34) & ">") - 1, 8)
   If InStr(GetQuote, "<") > 0 Then
       GetQuote = Left(GetQuote, InStr(GetQuote, "<") - 1)
   End If
End With

GetQuote_Exit:
   Set ie = Nothing
GetQuote_Err:
   GetQuote = Null
   Resume GetQuote_Exit
End Function

David Miller

Schultz wote:
> I use excel to pull quotes off of MSN Money (it comes with that option).
>
[quoted text clipped - 13 lines]
>
> Thanks.
Dave Miller - 11 Dec 2006 18:05 GMT
Schultz,

One more thing, I neglected to add an Exit Function in the
GetQuote_Exit:

You will want to paste this in the GetQuote_Exit:
-Right under "Set ie = nothing"
-Paste "Exit Function"

If you don't do this the function will return an error everytime.

David Miller

Dave Miller wote:
> Schultz,
>
[quoted text clipped - 64 lines]
> >
> > Thanks.
Schultz - 12 Dec 2006 03:48 GMT
Dave, thanks so much.   The only problem is I don't know anything about
excel programming.  I'll try to figure it out.

But what's a "module"?  How do I open one up?

Thanks again!

> Schultz,
>
[quoted text clipped - 83 lines]
>> >
>> > Thanks.
Gord Dibben - 12 Dec 2006 04:02 GMT
If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module.  Paste the code in there.  Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo.

Gord Dibben  MS Excel MVP

>Dave, thanks so much.   The only problem is I don't know anything about
>excel programming.  I'll try to figure it out.
[quoted text clipped - 90 lines]
>>> >
>>> > Thanks.

Gord Dibben  MS Excel MVP
Ron Rosenfeld - 11 Dec 2006 18:12 GMT
>I use excel to pull quotes off of MSN Money (it comes with that option).
>
[quoted text clipped - 13 lines]
>
>Thanks.

If you don't use the correct symbol, you won't obtain valid information. You
need to learn how to use the symbol lookup feature of moneycentral.msn.com.

It's not unusual for data providers to have somewhat arcane symbology to
represent indices.

I found the following symbols as variations of your IWD and EWW.  Hopefully one
of them will "fit".

$IWD.EU    iSHARES RUSSELL 1000 VALUE(Estimated Cash Amount Per Creation Unit)
$IWD.NV    iSHARES RUSSELL 1000 VALUE(Net Asset Value)
$IWD.SO    iSHARES RUSSELL 1000 VALUE(Shares Outstanding)
$IWD.TC    iSHARES RUSSELL 1000 VALUE(Total Cash Amount Per Creation Unit)
$IWD.IV    iSHARES RUSSELL 1000 VALUE(Underlying Trading Value)

and for the Mexico Index:

$EWW.EU    iSHARES MSCI MEXICO INDEX FD(Estimated cash amount per creation unit)
$EWW.IV    iSHARES MSCI MEXICO INDEX FD(Indicative Optimized Portfolio Value)
$EWW.NV    iSHARES MSCI MEXICO INDEX FD(Net Asset Value)
$EWW.SO    iSHARES MSCI MEXICO INDEX FD(Shares Outstanding)
$EWW.TC    iSHARES MSCI MEXICO INDEX FD(Total Cash Amount Per Creation Unit)

--ron
Schultz - 12 Dec 2006 03:56 GMT
Ron, thanks.  How did you locate those, starting from scratch?  I can't seem
to figure it out.

They work in microsoft excel, but I don't see a trading value for EWW, for
example.   But these are not really indices, but exchange traded funds
traded on the AMEX!  So it seems wierd as heck
that they don't have the trading value!

>>I use excel to pull quotes off of MSN Money (it comes with that option).
>>
[quoted text clipped - 44 lines]
>
> --ron
Schultz - 12 Dec 2006 04:00 GMT
OK, I figured out how you got those.  But its still quite bizarre that they
don't have the current (delayed) trading price, when they trade on the AMEX
just like any other stock.  And I really need the current trading price
rather than some proxy.

Thanks fellas.

>>I use excel to pull quotes off of MSN Money (it comes with that option).
>>
[quoted text clipped - 44 lines]
>
> --ron
Ron Rosenfeld - 12 Dec 2006 05:03 GMT
>OK, I figured out how you got those.  But its still quite bizarre that they
>don't have the current (delayed) trading price, when they trade on the AMEX
>just like any other stock.  And I really need the current trading price
>rather than some proxy.
>
>Thanks fellas.

OK, I did not realize you wanted the ETF.  I thought you only wanted the index.
And I don't see a way of getting today's price at the money web site.

But you could perhaps do a web query.

Data/External Data/New Web Query

A browser opens.  Go to www.amex.com and enter the ETF Symbol in the quote
window.

Follow the instructions.

You may have to do a separate query for each ETF, or you may be able to combine
them.

--ron

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.