Instead
Set ie = New InternetExplorerMedium
just use
Set ie = New InternetExplorer
or, for late binding:
Set ie = CreateObject("InternetExplorer.Application")
This will result in an error.
I'm not sure why you would use InternetExplorerMedium in the first place. Quoting a small print in the documentation :
Notes
Windows Internet Explorer 8. In Windows Vista, pass CLSID_InternetExplorerMedium (defined in exdisp.idl) to CoCreateInstance to create an instance of Internet Explorer that runs at the integrity level . The resulting InternetExplorerMedium object supports the same events, methods, and properties as the InternetExplorer object.
Are you really using IE8 on Windows Vista, and do you really want a “medium level of integrity”, whatever that means? I didn’t think so.
source share