VBA automation error in CreateObject(“InternetExplorer.Application”)

前端 未结 3 2080
谎友^
谎友^ 2020-12-15 14:06

I am getting the an automation error while invoking the following object

Set IE = CreateObject(\"InternetExplorer.Application\")

The error

3条回答
  •  粉色の甜心
    2020-12-15 15:05

    I just wasted 4 hours on this, and I'm facepalming at how easy the solution was. Excel creates a new activeX instance every time you run the line:

    Set IE = CreateObject("InternetExplorer.Application")
    

    How exactly that works is out of my league, but those references stick around even after you restart excel. After a couple dozen pile up, excel runs out of memory to make more

    Restart your computer, (probably an easier way, but that worked for me) and then stick the line

    IE.Quit 
    

    at the end of your code

提交回复
热议问题