Hi
I am trying to get a full list of shares (1289 rows in total) from LSE website into Excel, but I get an error "Run-time error '438': Object doesn't support this property or method'' and, as I am a novice wasn't sure how to fix it.
I wondered if you may assist me?
Below is my code and error appears at "For t = 0 To (elemCollection" section-
Much appreciated!Sub ImportLSEData() Dim IE As Object, obj As Object Dim t As Integer, r As Integer, c As Integer Dim elemCollection As Object Set IE = CreateObject("InternetExplorer.Application") With IE .Visible = True .navigate "http://www.londonstockexchange.com/exchange/prices-and-markets/stocks/prices-search/stock-prices-search.html" While IE.readyState <> 4 DoEvents Wend Set obj = IE.document.all.Item Set elemCollection = IE.document.getElementsByTagName("table") For t = 0 To (elemCollection.Length - 1) For r = 0 To (elemCollection(t).Rows.Length - 1) For c = 0 To (elemCollection(t).Rows(r).Cells.Length - 1) ThisWorkbook.Worksheets(1).Cells(r + 1, c + 1) = elemCollection(t).Rows(r).Cells(c).innerText Next c Next r Next t End With Set IE = Nothing End Sub
Bookmarks