What am I doing wrong?
Sub extractTablesData() Dim IE As Object, obj As Object Dim t As Integer, r As Integer, c As Integer Dim elemCollection As Object Dim xlApp As Excel.Application Dim wb As Workbook Dim ws As Worksheet Set IE = CreateObject("InternetExplorer.Application") Set xlApp = CreateObject("excel.application") Set wb = ActiveWorkbook With IE .Visible = True .navigate ("https://app.powerbi.com/view?r=eyJrIjoiODM0MmVhOGEtZWM1My00NTlkLWI3OWUtYTdkNDVkMmM5YWRiIiwidCI6IjE0MTk0ZTdlLTgwYjctNGM4Zi1hMTgwLTNmZTc4YWE1OGExZiIsImMiOjZ9") While IE.ReadyState <> 4 DoEvents Wend Do While IE.busy: DoEvents: Loop With ws Sheets("Stuff").Range("A1:AK500").ClearContents End With 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) With ws Sheets("Stuff").Cells(r + 1, c + 1) = elemCollection(t).Rows(r).Cells(c).innertext DoEvents End With Next c Next r Next t End With Set IE = Nothing End Sub
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: