henryvii99
New Member
- Joined
- Apr 22, 2011
- Messages
- 32
Hello everyone,
I am trying to learn VB for stock quoting.
I want to quote the index from this site.
https://www.etnet.com.hk/www/eng/stocks/realtime/quote.php?code=0011
I would like to quote Nominal, High, Low and Turnover values in the blue boxes. And P/E ratio in the table. and export it to Excel
I found a thread posted 3 years ago which may be very useful for this purpose. (Thanks Tom Schreiner and everyone else for their efforts.)
Extracting web data from a sub web page http://excel.bigresource.com/Track/excel-6zCXgwED/
It seems that CNBC got some updates from now and I modified them as far as I can understand. I changed a few lines in class module RTDItem.
==========================================
Private Const UrlPart As String = "http://www.cnbc.com/id/15837290?q="
to
Private Const UrlPart As String = "http://data.cnbc.com/quotes/"
==========================================
Set LastSpan = HTMLDoc.getElementById("WSODQ_" & pSymbol & "_LAST_0_" & pSessionID)
to
Set LastSpan = HTMLDoc.getElementById("WSODQSTREAMOFF_" & pSymbol & "_LAST_0_" & pSessionID)
===========================================
I tried to use the UDF, but Excel hang after I enter the symbol MSFT to the function (as in the original post), any ideas? It seems that the original template Excel files are removed. I cannot find the UDF and Realtime Data Sync Example sheets anywhere in the web.
By the way, I will be very happy if someone can actually quote the numbers from the website for Hong Kong stock market
Thanks everyone in advance!!
I am trying to learn VB for stock quoting.
I want to quote the index from this site.
https://www.etnet.com.hk/www/eng/stocks/realtime/quote.php?code=0011
I would like to quote Nominal, High, Low and Turnover values in the blue boxes. And P/E ratio in the table. and export it to Excel
I found a thread posted 3 years ago which may be very useful for this purpose. (Thanks Tom Schreiner and everyone else for their efforts.)
Extracting web data from a sub web page http://excel.bigresource.com/Track/excel-6zCXgwED/
It seems that CNBC got some updates from now and I modified them as far as I can understand. I changed a few lines in class module RTDItem.
==========================================
Private Const UrlPart As String = "http://www.cnbc.com/id/15837290?q="
to
Private Const UrlPart As String = "http://data.cnbc.com/quotes/"
==========================================
Set LastSpan = HTMLDoc.getElementById("WSODQ_" & pSymbol & "_LAST_0_" & pSessionID)
to
Set LastSpan = HTMLDoc.getElementById("WSODQSTREAMOFF_" & pSymbol & "_LAST_0_" & pSessionID)
===========================================
I tried to use the UDF, but Excel hang after I enter the symbol MSFT to the function (as in the original post), any ideas? It seems that the original template Excel files are removed. I cannot find the UDF and Realtime Data Sync Example sheets anywhere in the web.
By the way, I will be very happy if someone can actually quote the numbers from the website for Hong Kong stock market
Thanks everyone in advance!!