Minggu, 17 Agustus 2014

[smf_addin] Digest Number 3152

2 Messages

Digest #3152

Messages

Sat Aug 16, 2014 7:15 pm (PDT) . Posted by:

chaim422

Randy, is there a way to get the RCHGetTableCell() function to update in real time every time I press F9?

Sat Aug 16, 2014 8:56 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

It's possible, but I wouldn't recommend it. What I would recommend is using
the smfForceRecalculation macro instead. Just assign it to a toolbar button
and use it when you want to refresh everything.

In any case, if you MUST make the RCHGetTableCell() functions refreshable
using F9, you need to pass a different URL, so the add-in will get that new
web page and extract data from it. For example:

C2: =RAND()
C3: ="MMM"
C4: =RCHGetTableCell("http://finance.yahoo.com/q/ks?s="&C3&"&smf="&$C$2,1,">Market
Cap")

The "&smf=" is just a dummy variable I'm passing to the web page address.
The web page will just ignore that parameter. However, since the result of
the RAND() function in cell C2 will change each time you hit F9 (or change
something on the worksheet), it will update the URL being used by the
function in cell C3.

Note that since the add-in only stores 1000 web pages for data extraction,
so if you are retrieving data from 100 web pages with your functions, 100
new web pages would be retrieved each time F9 is pressed. So after ten
presses of F9, all further returned web pages will error out.

I've used this technique on a limited basis. Since it updates the functions
using cell C2, it only needs to be changed. In some cases, I'll just put
something like a default of "a" in there. When I want functions using that
cell to update, I can change it manually to "b". Then "c". Etc. It's just a
way I sometimes make individual worksheets update. But I still use
smfForceRecalculation if I want all worksheets in the workbook to update.
Otherwise, if it's always "a", everything works as it would have without
it. It just adds a little flexibility.

In some cases, you can even force RCHGetElementNumber() to update with F9,
by:

C5: =RCHGetElementNumber(C3&"&smf="&$C$2,941)

Since the ticker symbol will typically end when a new variable starts, this
tricks RCHGetElementNumber() into creating a new URL because of the stuff
added to the end of the ticker symbol. However, not all element numbers can
be tricked in this manner.

On Sat, Aug 16, 2014 at 7:15 PM, chaim422@... wrote:

>
> Randy, is there a way to get the RCHGetTableCell() function to update in
> real time every time I press F9?
>
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar