Kamis, 30 Januari 2014

[smf_addin] Digest Number 2947

7 New Messages

Digest #2947
1a
Obscure (?) UK Funds by graham_blaah
1b
Re: Obscure (?) UK Funds by "Randy Harmelink" rharmelink
1c
1d
1e
1f
Re: Obscure (?) UK Funds by "Randy Harmelink" rharmelink
1g

Messages

Wed Jan 29, 2014 10:01 am (PST) . Posted by:

graham_blaah

Hi Randy.
First off, thanks for this. It's brilliant. I love the coding, it's all so elegant!


I'm new to this, so please forgive me if it's an obvious answer.


I'm trying to get the daily price of some UK funds, some of which are available on Yahoo. For these I found the most reliable method was
=RCHGetYahooHistory($D16,,,,,,,"d","AD",0)
with an example code such as GB00B1DDK131.L.


However, some codes are listed on Yahoo, but don't have the data, such as GB00B6QR2553.L. Daily prices are listed on Morningstar under the Overview page:
http://www.morningstar.co.uk/uk/funds/snapshot/snapshot.aspx?id=F00000MWK6 http://www.morningstar.co.uk/uk/funds/snapshot/snapshot.aspx?id=F00000MWK6



but I can't see anything in RCHGetElementNumber() to access it.


Am I being thick, or is there a better way?


Many thanks.

Wed Jan 29, 2014 10:18 am (PST) . Posted by:

"Randy Harmelink" rharmelink

I don't see any daily prices on MorningStar's Overview page...

Since it's a UK site, I wouldn't have defined any elements for it. You'd
have to use the other general functions, such as RCHGetTableCell() or
smfGetTagContent(). Most of the RCHGetElementNumber() data elements are
just saved versions of an RCHGetTableCell() function.

On Wed, Jan 29, 2014 at 5:20 AM, <graham_blaah@yahoo.com> wrote:

>
> However, some codes are listed on Yahoo, but don't have the data, such
> as GB00B6QR2553.L. Daily prices are listed on Morningstar under the
> Overview page:
> http://www.morningstar.co.uk/uk/funds/snapshot/snapshot.aspx?id=F00000MWK6
>
> but I can't see anything in RCHGetElementNumber() to access it.
>
> Am I being thick, or is there a better way?
>
>

Wed Jan 29, 2014 12:59 pm (PST) . Posted by:

graham_blaah

Ah. It might not be daily prices, but the figure quoted against NAV. That was good enough for what I was after.


I did manage to get the figure this afternoon using RCHGetTableCell() and some text manipulation, but now the same formulae are returning "Error".


I despair, but I'll work through it.


Thanks again.

Wed Jan 29, 2014 1:33 pm (PST) . Posted by:

graham_blaah

OK I'm stumped. Why is this no longer working?


=VALUE(SUBSTITUTE(RCHGetTableCell(D15,2,"IMA Sector","NAV"),"GBX ",""))



With D15 =


http://www.morningstar.co.uk/uk/funds/snapshot/snapshot.aspx?id=F0GBR04S5Y http://www.morningstar.co.uk/uk/funds/snapshot/snapshot.aspx?id=F0GBR04S5Y

It was fine this afternoon.

Wed Jan 29, 2014 1:50 pm (PST) . Posted by:

graham_blaah

Something to do with stored values apparently, even after closing and restarting Excel?


smfForceRecalculation sorted the problem

Wed Jan 29, 2014 2:08 pm (PST) . Posted by:

"Randy Harmelink" rharmelink

smfForceRecalculation just empties out the stored web pages (within the VBA
environment) and then triggers a recalculation, which causes a fresh web
page to be retrieved.

But closing and restarting EXCEL resets the entire VBA environment. So it
does everything smfForceRecalculation does, and a lot more.

There is another possibility -- the add-in uses the XMLHTTP protocol, which
is what Internet Explorer uses. So they both use all of the same cookies
and temporary Internet files. It could be your Internet Options are not set
up to ALWAYS get a fresh copy of a web page.

When I tried your formula, it worked here.

However, I would suggest using smfConvertData() instead of VALUE(). If the
other two functions return something non-numeric, the VALUE() function will
give you a #VALUE! error, and you'll have no idea why. But smfConvertData()
will return the data that can't be converted into a numeric value. So you
can see what the issue might be.

On Wed, Jan 29, 2014 at 2:50 PM, <graham_blaah@yahoo.com> wrote:

> Something to do with stored values apparently, even after closing and
> restarting Excel?
>
>
> - smfForceRecalculation sorted the problem
>
>

Wed Jan 29, 2014 3:22 pm (PST) . Posted by:

graham_blaah

smfForceRecalculation() solved it !

Tidak ada komentar:

Posting Komentar