View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default createDocumentFromURL

Try replacing this:
Set oHTMLDoc = oMSHTML.createDocumentFromUrl(sQuoteQuery, vbNullString)

with something like:
.....
dim oWB as workbook
....
set oWB=workbooks.open sQuoteQuery
'you should then be able to extract your information from the new workbook
oWB.close

Tim.


--
Tim Williams
Palo Alto, CA


"Jack Clift" wrote in message
...
Here is the code, will try the xmlhttp stuff as suggested. Again, thanks

for
the ongoing assistance.

JC

Function TradingRoomGetQuoteData(ByVal sWS As String) As Boolean
Dim oMSHTML As MSHTML.HTMLDocument
Dim oHTMLDoc As MSHTML.HTMLDocument
Dim oDataTable As MSHTML.HTMLTable
Dim oWebTables As Object

Dim oWB As Workbook
Dim oWSCompanyList As Worksheet

Dim sQuoteQuery As String
Dim sTableData As String
Dim sASXCodes As String
Dim sURL As String

Dim iLastCompanyRow As Integer
Dim iCompanyRow As Integer
Dim iTableRow As Integer
Dim iTableCell As Integer

Dim bFoundLast As Boolean, bFoundYield As Boolean, bFoundCap As

Boolean

Set oMSHTML = New MSHTML.HTMLDocument

Set oWB = ActiveWorkbook
Set oWSCompanyList = oWB.Worksheets(sWS)

sURL =

"http://tradingroom.com.au/apps/qt/quote.ac?section=quotedetail&sy=tpl&type=
delayedquote&code="

iLastCompanyRow = oWSCompanyList.Cells.SpecialCells(xlLastCell).Row -

1

iCompanyRow = ASXLIST_OFFSET

Do While iCompanyRow <= iLastCompanyRow

sASXCodes = oWSCompanyList.Cells(iCompanyRow, 2).Value
'sQuoteQuery = sURL & "BHP"
sQuoteQuery = sURL & sASXCodes
Set oHTMLDoc = oMSHTML.createDocumentFromUrl(sQuoteQuery,
vbNullString)

While oHTMLDoc.readyState < "complete"
DoEvents
Wend
'other code here deleted for simplicity
iCompanyRow = iCompanyRow + 1
Loop

End Function


"Tim Williams" wrote:

Maybe you could show your exact code - or at least the part which is
erroring out.
I noticed that the page does have a pop-up which launches on load -
don't know if that's the issue.

You could always try using XMLHTTP to grab the source, save it locally
and then open it from there.
Or just open the page directly in Excel.

Tim.


"Jack Clift" wrote in message
...
PS think that it might have something to do with cookie handling, as
there is
a similar issue reported in the MSDN knowledge base about
unspecified
potential security issue.

refer:

http://support.microsoft.com/default...b;en-us;323034

does this prompt any ideas?

Regards

JC

"Tim Williams" wrote:

Doesn't give me a warning. Try adusting your IE settings.

Tim