I have a macro to gather all text in a website (saw the code from other website). It works on my machine but does not work on others. The runtime error is 13, type mismatch.
I referenced:
Microsoft HTML Object Library
Microsoft Internet Controls
Microsoft Scripting Runtime
Microsoft Forms 2.0 Object Library
I referenced:
Microsoft HTML Object Library
Microsoft Internet Controls
Microsoft Scripting Runtime
Microsoft Forms 2.0 Object Library
VBA Code:
Sub get_temperature()
Sheets("workspace").Select
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
.navigate "https://www.accuweather.com/en/us/boulder-co/80302/March-weather/327347" ' should work for any URL
Do Until .READYSTATE = 4: DoEvents: Loop
gettemps = .document.body.innerText
gettemps = Replace(gettemps, Chr(10), Chr(13))
gettemps = Split(gettemps, Chr(13))
Worksheets("workspace").Range("A1").Resize(UBound(gettemps)) = Application.Transpose(gettemps)
.Quit
End With
End Sub