9 Messages
Digest #3169
Messages
Wed Sep 3, 2014 4:52 am (PDT) . Posted by:
"Randy Harmelink" rharmelink
That makes no sense to me at all, because of what you reported you got back
from the smfGetTagContent() function in the previous message.
I ran the steps on JUST your posted results, not using the
smfGetTagContent() function, and it worked fine all the way through --
using the TEXT string.
Do you have an older version of EXCEL? It could be the string is too long
for that version.
On Tue, Sep 2, 2014 at 9:17 PM, picsound@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> getting blanks in the step # 1
>
from the smfGetTagContent() function in the previous message.
I ran the steps on JUST your posted results, not using the
smfGetTagContent() function, and it worked fine all the way through --
using the TEXT string.
Do you have an older version of EXCEL? It could be the string is too long
for that version.
On Tue, Sep 2, 2014 at 9:17 PM, picsound@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> getting blanks in the step # 1
>
Wed Sep 3, 2014 4:53 am (PDT) . Posted by:
"Randy Harmelink" rharmelink
Sounds like the Zacks web site may have been down.
On Tue, Sep 2, 2014 at 9:34 PM, tarakayan@yahoo.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> I use Windows 8.1 and Excel 2013….all my templates with RCH functions
> mainly yahoo are working well.
>
> I tried the following in one of the cells, but says unable to open
> www.zacks.com…and blank in the step 1….I have the latest RCH files and
> updates.
>
> ------------------------------
>
> Step 1:
>
> =smfStrExtr(smfGetTagContent("http://www.zacks.com/stock/research/" &$C$5
> &"/earnings-announcements","script",-1,"Payable Date"),"""data"" : [ ","]")
>
On Tue, Sep 2, 2014 at 9:34 PM, tarakayan@yahoo.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> I use Windows 8.1 and Excel 2013….all my templates with RCH functions
> mainly yahoo are working well.
>
> I tried the following in one of the cells, but says unable to open
> www.zacks.com…and blank in the step 1….I have the latest RCH files and
> updates.
>
> ------------------------------
>
> Step 1:
>
> =smfStrExtr(smfGetTagContent("http://www.zacks.com/stock/research/" &$C$5
> &"/earnings-
>
Wed Sep 3, 2014 4:53 am (PDT) . Posted by:
"Randy Harmelink" rharmelink
That looks correct.
On Tue, Sep 2, 2014 at 9:54 PM, picsound@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> this is the vba function in module "modutilities"
>
> Function smfStrExtr(pString As String, pStart As String, pEnd As String)
>
> '----------------------------------------------------------*
> ' 2010.01.22 -- Add function
> ' 2010.06.06 -- Add error checking
> ' 2011.07.12 -- Add dummy characters to represent start and end of
> input string
>
> '----------------------------------------------------------*
> If pStart = "~" Then
> iPos1 = 1
> iPos3 = 2
> Else
> iPos1 = InStr(pString, pStart) + Len(pStart)
> iPos3 = iPos1
> If iPos1 = Len(pStart) Then
> smfStrExtr = ""
> Exit Function
> End If
> End If
> If pEnd = "~" Then iPos2 = Len(pString) + 1 Else iPos2 = InStr(iPos3,
> pString, pEnd)
> If iPos2 = 0 Then
> smfStrExtr = ""
> Exit Function
> End If
> smfStrExtr = Mid(pString, iPos1, iPos2 - iPos1)
> End Function
>
On Tue, Sep 2, 2014 at 9:54 PM, picsound@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> this is the vba function in module "modutilities&
>
> Function smfStrExtr(pString As String, pStart As String, pEnd As String)
>
> '-------
> ' 2010.01.22 -- Add function
> ' 2010.06.06 -- Add error checking
> ' 2011.07.12 -- Add dummy characters to represent start and end of
> input string
>
> '-------
> If pStart = "~" Then
> iPos1 = 1
> iPos3 = 2
> Else
> iPos1 = InStr(pString, pStart) + Len(pStart)
> iPos3 = iPos1
> If iPos1 = Len(pStart) Then
> smfStrExtr = ""
> Exit Function
> End If
> End If
> If pEnd = "~" Then iPos2 = Len(pString) + 1 Else iPos2 = InStr(iPos3,
> pString, pEnd)
> If iPos2 = 0 Then
> smfStrExtr = ""
> Exit Function
> End If
> smfStrExtr = Mid(pString, iPos1, iPos2 - iPos1)
> End Function
>
Wed Sep 3, 2014 7:28 am (PDT) . Posted by:
digsupply
I stayed up till 5AM, trying to solve this which doesn't seem to be something so difficult to fix. I tried several things. I have different computers, one with Windows Vista Home Edition and Excel 2007 Student, another with Vista Ultimate and Excel 2010 with all updates installed, and a third one with Windows Vista Ultimate and Excel 2007. I ran the formula on the each of them and it doesn't work on any of them.
I did the following: I split the formula into two, In "B1" I put in =smfGetTagContent("http://www.zacks.com/stock/research/SDRL/earnings-announcements http://www.zacks.com/stock/research/SDRL/earnings-announcements","script",-1,"Payable Date")
In Cell "D1" I put =smfStrExtr(B1,"""data"" : [ ","]"). I obtained the same result: Blank cell. It's evident the function =smfStrExtr is not working
Then I copied B1 and I pasted just the values (Using Paste Special) Also blank cell.
I wanted to check if the string was too long for my version of Excel to handle. I reduced the string to just a few lines before DATA and it didn't work , so I don't think that is the problem.
I also installed SMFaddin from 2009 (380k) on another computer, and also I get a blank returned
Last test, In the function I disabled the "Exit function" and I did obtain a result, though not the one I was looking for but at least a result
"Else
iPos1 = InStr(pString, pStart) + Len(pStart)
iPos3 = iPos1
If iPos1 = Len(pStart) Then
smfStrExtr = ""
' Exit Function
End If
End If"
All these trials were done with Excel 2010
I did the following: I split the formula into two, In "B1" I put in =smfGetTagContent("http://www.zacks.com/stock/research/SDRL/earnings-announcements http://www.zacks.com/stock/research/SDRL/earnings-announcements","
In Cell "D1" I put =smfStrExtr(
Then I copied B1 and I pasted just the values (Using Paste Special) Also blank cell.
I wanted to check if the string was too long for my version of Excel to handle. I reduced the string to just a few lines before DATA and it didn't work , so I don't think that is the problem.
I also installed SMFaddin from 2009 (380k) on another computer, and also I get a blank returned
Last test, In the function I disabled the "Exit function" and I did obtain a result, though not the one I was looking for but at least a result
"Else
iPos1 = InStr(pString, pStart) + Len(pStart)
iPos3 = iPos1
If iPos1 = Len(pStart) Then
smfStrExtr = ""
' Exit Function
End If
End If"
All these trials were done with Excel 2010
Wed Sep 3, 2014 7:38 am (PDT) . Posted by:
digsupply
These are my references in visual basic tools
Attachment(s) from
1 of 1 Photo(s)
Wed Sep 3, 2014 8:03 am (PDT) . Posted by:
"Randy Harmelink" rharmelink
Yours are significantly different than mine -- my Office and EXCEL object
libraries are version 12, not version 14.
And I don't have the Access object library or the Calendar controls or the
Common Controls.
But I don't think any of these is a factor.
On Wed, Sep 3, 2014 at 7:38 AM, picsound@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> These are my references in visual basic tools
>
> 1 of 1 Photo(s)
> [image: referencias.jpg]
> <https://groups.yahoo.com/neo/groups/smf_addin/attachments/1113227911;_ylc=X3oDMTJuZDI2Z2psBF9TAzk3MzU5NzE0BGdycElkAzE4MDk0NjIwBGdycHNwSWQDMTcwNTYzMjE5OARzZWMDYXR0YWNobWVudARzbGsDcGhvdG8Ec3RpbWUDMTQwOTc1NTA5Mw--?itemid=1267789513>
> referencias.jpg
> <https://groups.yahoo.com/neo/groups/smf_addin/attachments/1113227911;_ylc=X3oDMTJuZDI2Z2psBF9TAzk3MzU5NzE0BGdycElkAzE4MDk0NjIwBGdycHNwSWQDMTcwNTYzMjE5OARzZWMDYXR0YWNobWVudARzbGsDcGhvdG8Ec3RpbWUDMTQwOTc1NTA5Mw--?itemid=1267789513>
> ------------------------------
>
>
libraries are version 12, not version 14.
And I don't have the Access object library or the Calendar controls or the
Common Controls.
But I don't think any of these is a factor.
On Wed, Sep 3, 2014 at 7:38 AM, picsound@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> These are my references in visual basic tools
>
> 1 of 1 Photo(s)
> [image: referencias.jpg]
> <https://groups.yahoo.com/neo/groups/smf_addin/attachments/1113227911;_ylc=X3oDMTJuZDI2Z2psBF9TAzk3MzU5NzE0BGdycElkAzE4MDk0NjIwBGdycHNwSWQDMTcwNTYzMjE5OARzZWMDYXR0YWNobWVudARzbGsDcGhvdG8Ec3RpbWUDMTQwOTc1NTA5Mw--?itemid=1267789513>
> referencias.jpg
> <https://groups.yahoo.com/neo/groups/smf_addin/attachments/1113227911;_ylc=X3oDMTJuZDI2Z2psBF9TAzk3MzU5NzE0BGdycElkAzE4MDk0NjIwBGdycHNwSWQDMTcwNTYzMjE5OARzZWMDYXR0YWNobWVudARzbGsDcGhvdG8Ec3RpbWUDMTQwOTc1NTA5Mw--?itemid=1267789513>
> ------------
>
>
Wed Sep 3, 2014 8:17 am (PDT) . Posted by:
"Randy Harmelink" rharmelink
OK, let's try:
B1: =smfGetTagContent("
http://www.zacks.com/stock/research/SDRL/earnings-announcements","script",-1,"Payable
Date")
B2: =smfStrExtr(B1,"""data"" : [ ","]")
B3: =FIND("""data"" : [ ",B1)+len("""data"" : [ ")
B4: =FIND("]",B1,B3)
B5: =MID(B1,B3,B4-B3+1)
-- Your B1 comes back looking OK, right, as before?
-- Your B2 comes back blank, right? If so, not OK.
-- For B3, I get 1099.
-- For B4, I get 3028
-- B3/B4/B5 is what the smfStrExtr() function in B2 is supposed to be doing.
On Wed, Sep 3, 2014 at 7:28 AM, picsound@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> I stayed up till 5AM, trying to solve this which doesn't seem to be
> something so difficult to fix. I tried several things. I have different
> computers, one with Windows Vista Home Edition and Excel 2007 Student,
> another with Vista Ultimate and Excel 2010 with all updates installed, and
> a third one with Windows Vista Ultimate and Excel 2007. I ran the formula
> on the each of them and it doesn't work on any of them.
>
> I did the following: I split the formula into two, In "B1" I put in
> =smfGetTagContent("
> http://www.zacks.com/stock/research/SDRL/earnings-announcements","script",-1,"Payable
> Date")
>
> In Cell "D1" I put =smfStrExtr(B1,"""data"" : [ ","]"). I obtained the
> same result: Blank cell. It's evident the function =smfStrExtr is not
> working
>
> Then I copied B1 and I pasted just the values (Using Paste Special) Also
> blank cell.
>
> I wanted to check if the string was too long for my version of Excel to
> handle. I reduced the string to just a few lines before DATA and it didn't
> work , so I don't think that is the problem.
>
> I also installed SMFaddin from 2009 (380k) on another computer, and also
> I get a blank returned
>
> Last test, In the function I disabled the "Exit function" and I did
> obtain a result, though not the one I was looking for but at least a result
>
> "Else
> iPos1 = InStr(pString, pStart) + Len(pStart)
> iPos3 = iPos1
> If iPos1 = Len(pStart) Then
> smfStrExtr = ""
> ' Exit Function
> End If
> End If"
>
> All these trials were done with Excel 2010
>
B1: =smfGetTagContent("
http://www.zacks.com/stock/research/SDRL/earnings-announcements","script",-1,"Payable
Date")
B2: =smfStrExtr(B1,"""data"" : [ ","]")
B3: =FIND("""data"" : [ ",B1)+len("""data"" : [ ")
B4: =FIND("]",B1,B3)
B5: =MID(B1,B3,B4-B3+1)
-- Your B1 comes back looking OK, right, as before?
-- Your B2 comes back blank, right? If so, not OK.
-- For B3, I get 1099.
-- For B4, I get 3028
-- B3/B4/B5 is what the smfStrExtr() function in B2 is supposed to be doing.
On Wed, Sep 3, 2014 at 7:28 AM, picsound@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> I stayed up till 5AM, trying to solve this which doesn't seem to be
> something so difficult to fix. I tried several things. I have different
> computers, one with Windows Vista Home Edition and Excel 2007 Student,
> another with Vista Ultimate and Excel 2010 with all updates installed, and
> a third one with Windows Vista Ultimate and Excel 2007. I ran the formula
> on the each of them and it doesn't work on any of them.
>
> I did the following: I split the formula into two, In "B1" I put in
> =smfGetTagContent("
> http://www.zacks.com/stock/research/SDRL/earnings-announcements","
> Date")
>
> In Cell "D1" I put =smfStrExtr(
> same result: Blank cell. It's evident the function =smfStrExtr is not
> working
>
> Then I copied B1 and I pasted just the values (Using Paste Special) Also
> blank cell.
>
> I wanted to check if the string was too long for my version of Excel to
> handle. I reduced the string to just a few lines before DATA and it didn't
> work , so I don't think that is the problem.
>
> I also installed SMFaddin from 2009 (380k) on another computer, and also
> I get a blank returned
>
> Last test, In the function I disabled the "Exit function" and I did
> obtain a result, though not the one I was looking for but at least a result
>
> "Else
> iPos1 = InStr(pString, pStart) + Len(pStart)
> iPos3 = iPos1
> If iPos1 = Len(pStart) Then
> smfStrExtr = ""
> ' Exit Function
> End If
> End If"
>
> All these trials were done with Excel 2010
>
Wed Sep 3, 2014 7:20 am (PDT) . Posted by:
pgh2377
Thanks, I am beginning to understand...
But for a website that doesn't use a table, like trying to get the dividend amount for TXT or $.02 on cms marketwatch? How would the getwebdata work? I tried the following
http://www.marketwatch.com/investing/stock/txt http://www.marketwatch.com/investing/stock/txt
=smfConvertData(smfstrExtr(smfstrExtr(RCHGetWebData("www.marketwatch.com/investing/stock/txt",">Dividend",100),"<div","</div"),">","~"))
But for a website that doesn't use a table, like trying to get the dividend amount for TXT or $.02 on cms marketwatch? How would the getwebdata work? I tried the following
http://www.marketwatch.com/investing/stock/txt http://www.marketwatch.com/investing/stock/txt
=smfConvertData(
Wed Sep 3, 2014 8:27 am (PDT) . Posted by:
"Randy Harmelink" rharmelink
First off, this returns "Error":
=RCHGetWebData("www.marketwatch.com/investing/stock/txt",">Dividend",100)
...because you need the "http://" in front of the URL. But this:
=RCHGetWebData("http://www.marketwatch.com/investing/stock/txt
",">Dividend",100)
...returns this:
>Dividend</p> <p class="data lastcolumn">0.02</p> </div> <div
class="section"> <p
Since the amount is between "p" tags, the easiest extract would be:
=smfConvertData(smfGetTagContent("
http://www.marketwatch.com/investing/stock/txt","p",1,">Dividend"))
Otherwise, even with the URL corrected in your formula, the "<div" string
in the 100 bytes we had returned by the RCHGetWebData() function is after
the "</div" string, not before. Here are the steps you would have needed:
B1: =RCHGetWebData("http://www.marketwatch.com/investing/stock/txt
",">Dividend",100)
B2: =smfStrExtr(B1,"<p","</p")
B3: =smfStrExtr(B2,">","~")
B4: =smfConvertData(B3)
...or, putting them all together:
=smfConvertData(smfStrExtr(smfStrExtr(RCHGetWebData("
http://www.marketwatch.com/investing/stock/txt
",">Dividend",100),"<p","</p"),">","~"))
On Wed, Sep 3, 2014 at 7:20 AM, pgh2377@yahoo.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> Thanks, I am beginning to understand...
>
> But for a website that doesn't use a table, like trying to get the
> dividend amount for TXT or $.02 on cms marketwatch? How would the
> getwebdata work? I tried the following
>
> http://www.marketwatch.com/investing/stock/txt
>
> =smfConvertData(smfstrExtr(smfstrExtr(RCHGetWebData("
> www.marketwatch.com/investing/stock/txt
> ",">Dividend",100),"<div","</div"),">","~"))
>
=RCHGetWebData("www.marketwatch.com/investing/stock/txt",">Dividend",100)
...because you need the "http://" in front of the URL. But this:
=RCHGetWebData("http://www.marketwatch.com/investing/stock/txt
",">Dividend",100)
...returns this:
>Dividend</p> <p class="data lastcolumn">0.02</p> </div> <div
class="section"> <p
Since the amount is between "p" tags, the easiest extract would be:
=smfConvertData(smfGetTagContent("
http://www.marketwatch.com/investing/stock/txt","p",1,">Dividend"))
Otherwise, even with the URL corrected in your formula, the "<div" string
in the 100 bytes we had returned by the RCHGetWebData() function is after
the "</div" string, not before. Here are the steps you would have needed:
B1: =RCHGetWebData("http://www.marketwatch.com/investing/stock/txt
",">Dividend",100)
B2: =smfStrExtr(B1,"<p","</p")
B3: =smfStrExtr(B2,">","~")
B4: =smfConvertData(B3)
...or, putting them all together:
=smfConvertData(smfStrExtr(smfStrExtr(RCHGetWebData("
http://www.marketwatch.com/investing/stock/txt
",">Dividend",100),"<p","</p"),">","~"))
On Wed, Sep 3, 2014 at 7:20 AM, pgh2377@yahoo.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:
>
> Thanks, I am beginning to understand...
>
> But for a website that doesn't use a table, like trying to get the
> dividend amount for TXT or $.02 on cms marketwatch? How would the
> getwebdata work? I tried the following
>
> http://www.marketwatch.com/investing/stock/txt
>
> =smfConvertData(
> www.marketwatch.
> ","
>
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF
Tidak ada komentar:
Posting Komentar