'Run-time error in VBA when trying to use Internet Explorer object
I am trying to do some web-scraping in Excel-VBA and I am getting the following error:
Run-time error '-2147467259 (80004005)':
Unspecified error
I have narrowed it down to this code:
Sub test()
Dim IE As New SHDocVw.InternetExplorer
IE.Visible = False '<- I get the error here
End Sub
The IE object seems to be created properly, as I can see it in the locals window. I just can't use it for some reason.
It is confusing because it was working just a few hours ago. I even recovered a previous version of the file in case I accidentally changed something, but still it is not working anymore.
These are the references I have on:
Any idea what is going on?
Solution 1:[1]
try
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
if it works you may change
IE.Visible = false
if you do not have InternetExplorer installed that could be the problem. (Edge browser is not InternetExplorer)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

